Skip to content

Instantly share code, notes, and snippets.

@drmuey
Last active August 13, 2021 17:47
Show Gist options
  • Save drmuey/02c6b3b67b100ef114c3407331d3cbff to your computer and use it in GitHub Desktop.
Save drmuey/02c6b3b67b100ef114c3407331d3cbff to your computer and use it in GitHub Desktop.
Concise Docker notes
  • CMD
    • spin up image, run CMD, stop
    • w/ docker run arg ➜ run this instead of CMD
    • Same w/ dockder run … CMD
  • ENTRYPOINT
    • spin up image, run ENTRYPOINT, stop
    • w/ docker run arg ➜ append to ENTRYPOINT arguments
    • Same w/ dockder run … --entrypoint=ENTRYPOINT
  • CMD && ENTRYPOINT
    • spin up image, run ENTRYPOINT w/ CMD appended to ENTRYPOINT arguments, stop
    • w/ docker run arg ➜ replaces CMD in ^^^
    • Same w/ dockder run … CMD --entrypoint=ENTRYPOINT

Note: “stop” is when the process of the last thing goes away, so a daemon running in the FG will keep the image up 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment