dockerfile basics

/home/pyratebeard/src/udemy/docker_mastery/dockerfile-sample-1

  • 'recipe' for creating images
  • use -f to specify dockerfile
  • must include FROM line to start
    • to start with an empty container use FROM scratch
  • each stanza is another layer in the cache
  • point logs to /dev/{stdout,stderr}
  • EXPOSE to open ports, still use -p
  • CMD is required and is run when the container is launched
  • WORKDIR better than using cd command

extending official samples

/home/pyratebeard/src/udemy/docker_mastery/dockerfile-sample-2

  • inherit everything from FROM
    • used CMD from building image