-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise Dockerfile with more best practices #205
Comments
Pin to a specific Debian release as the source docker image |
Make it identifiable: via Docker The problem with tags is that they’re not embedded into the image. So if you deployed yourimage:latest, you won’t know what other tags it used to have. One solution is to embed the metadata as labels inside the image itself: docker build -t myimage:latest --label git-commit=$GIT_COMMIT . |
Make it identifiable: via logs and public API You can also use build arguments to customize the build; this allows you to pass in the git commit, store it in the image as a file, and then your application can include it in a status API endpoint, or as part of application logging on startup. FROM centos And then we can pass it in: $ docker build -t myimage --build-arg git_commit=$GIT_COMMIT . |
From https://pythonspeed.com/docker
https://pythonspeed.com/articles/root-capabilities-docker-security/
https://pythonspeed.com/articles/docker-cache-insecure-images/
The text was updated successfully, but these errors were encountered: