Dockerfile: From Start to Optimized (DockerCon 2023)
ฝัง
- เผยแพร่เมื่อ 10 ก.ย. 2024
- Learn how to write a Dockerfile and then optimize it. Discover what Dockerfile instructions do and patterns for optimizing your Dockerfile for quicker builds.
We start with a basic HTTP, server written in Go, and no Dockerfile. By the end of the presentation, you will have an optimized Dockerfile for building running the application. By the end of this session, you should have a better understanding of modern capabilities that Docker Build provides, best practices, and common patterns.
Presentation: Dockerfile: From Start to Optimized
Speaker: David Karlsson, Technical Writer, Docker
Resources:
Docker Build - docs.docker.co...
Best practices for writing Dockerfiles - docs.docker.co...
Docker development best practices - docs.docker.co...
Get started with Docker - www.docker.com...
What are containers? www.docker.com...
Try Docker Desktop www.docker.com...
Docker 101 Tutorial www.docker.com...
Join the conversation!
LinkedIn → dockr.ly/LinkedIn
Twitter → dockr.ly/Twitter
Facebook → dockr.ly/Facebook
Instagram → dockr.ly/Insta...
ABOUT DOCKER: Docker provides a suite of development tools, services, trusted content, and automations, used individually or together, to accelerate the delivery of secure applications.
#docker #devops #dockerfile
Very good session, thanks
👏👏👏👏 great talk
Great one
Is there a way to understand how each part of the docker file works and know what is acceptable and is not? I want to debug my projects but I need to have a grasp of how docker works and than how to debug.
`--mount=type=bind,target=.` doesn't work, why?
When you use that flag with a `RUN` instruction, that should bind-mount the build context into your current working directory in the build container. The files are mounted as read-only by default. If you wish to mount them as writable, you can append `,rw` after the target parameter.
For further troubleshooting your build, there's an experimental command that lets you run a debug session for failing builds, to get a shell and the filesystem of the build container (including bind mounts). You can try it out with: `BUILDX_EXPERIMENTAL=1 docker buildx debug build .`
Note that it's experimental at this point and that the UX isn't perfect, but maybe it will help you understand what's going on in your build container better.