dockerfile commands

Common Dockerfile commands are

  • FROM — set base image
  • RUN — execute command in container
  • ENV — set environment variable
  • WORKDIR — set working directory
  • VOLUME — create mount-point for a volume
  • CMD — set executable for container
  • ADD - ADDS files (Expanding some types)
  • COPY - ADDS files - Not Expanding tar,zip etc

Recommendations

  • 1 application = 1 container
  • Run process in foreground (don’t use systemd, upstart or any other similar tools)
  • Keep data out of container — use volumes
  • Do not use SSH (if you need to step into container you can use docker exec command
  • Avoid manual configurations (or actions) inside container