Skip to main content

Dockerfile

Dockerfile

  • dockerfile manuals:
    • https://takacsmark.com/dockerfile-tutorial-by-example-dockerfile-best-practices-2018/

key instructions

  • CMD
    • what command should be run in the image
    • CMD [“executable”, “param1”, “param2”, ...]
    • Its possible to override the command on starting up a container docker run myImage:latest _command_
    • Only last CMD will be used (so specifiy only one).
    • Its a good practice to specify at leaset a shell command here.
  • ENTRYPOINT
    • Used to specify the 'main executable' of the image
    • If ENTRYPOINT is specified, CMD paramas will be added to the ENTRYPOINT
    • ENTRYPOINT ["git"]
      CMD ["--help"]
      

build dockerfile

docker build -t getting-started .