All articles

From the blog

CHEATSHEET: Dockerfile - Basic Syntax and Concepts

Instructions

  • FROM - initializes a new build stage and sets the base image for subsequent instructions
  • RUN - will execute any commands in a new layer on top of the current image and commit the results which will be used for the next step in the Dockerfile
  • CMD - used to provide defaults for an executing container such as an executable and its arguments
  • COPY <src> <dest> - copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>
  • WORKDIR - sets the working directory to the specified directory for following instructions in the Dockerfile

Back to the blog