Allow specifying docker container in which to build code
See original GitHub issueDescribe your idea/feature/enhancement
Sometimes with Python code one requires compiling packages that rely on C libraries. For example, trying to install mysqlclient
in the default container will result in an error.
A way to overcome this issue, is to create a new Docker image, based on the lambci/lambda:build-python2.7
one, that will have mysql-devel
and python-devel
installed in it, and use it when running sam build -u
.
Proposal
An obvious solution is just to provide an optional flag, e.g.
sam build --use-container --docker-image lambci/lambda:my-awesome-image
Additional Details
I don’t know enough about the SAM CLI infra to say, but if possible, it would be even better if one could provide a Dockerfile
in the template.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:13
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Allow specifying docker container in which to build code #1231
A way to overcome this issue, is to create a new Docker image, based on the lambci/lambda:build-python2.7 one, that will have mysql-devel and ......
Read more >docker build - Docker Documentation
The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in...
Read more >Containerize an application - Docker Documentation
Start an app container · Start your container using the docker run command and specify the name of the image you just created:...
Read more >Image-building best practices - Docker Documentation
When you have built an image, it is a good practice to scan it for security vulnerabilities using the docker scan command. Docker...
Read more >Docker development best practices - Docker Documentation
Docker development best practices. The following development patterns have proven to be helpful for people building applications with Docker.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@prcongithub You could build the image locally, retag it as the image we download, and then pass
--skip-pull-image
.@simlu no, I’m still building things with the old containers