Dockerfile: From Start to Optimized (DockerCon 2023)

Sdílet
Vložit
  • čas přidán 23. 11. 2023
  • 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.com/build/
    Best practices for writing Dockerfiles - docs.docker.com/develop/devel...
    Docker development best practices - docs.docker.com/develop/dev-b...
    Get started with Docker - www.docker.com/get-started/
    What are containers? www.docker.com/resources/what...
    Try Docker Desktop www.docker.com/products/docke...
    Docker 101 Tutorial www.docker.com/101-tutorial/
    Join the conversation!
    LinkedIn → dockr.ly/LinkedIn
    Twitter → dockr.ly/Twitter
    Facebook → dockr.ly/Facebook
    Instagram → dockr.ly/Instagram
    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
  • Věda a technologie

Komentáře • 6

  • @Yooakim
    @Yooakim Před 6 měsíci +3

    Very good session, thanks

  • @jssmntll
    @jssmntll Před 6 měsíci +3

    👏👏👏👏 great talk

  • @jdhshs12
    @jdhshs12 Před 6 měsíci +3

    Great one

  • @andrewstribling4385
    @andrewstribling4385 Před 5 měsíci +1

    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.

  • @BatkhuuByambajav
    @BatkhuuByambajav Před 5 měsíci

    `--mount=type=bind,target=.` doesn't work, why?

    • @dvdksn-docker
      @dvdksn-docker Před 4 měsíci +1

      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.