Skip to content

Instantly share code, notes, and snippets.

@pratos
Created November 21, 2017 19:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pratos/86a3bb07bde32abf8de1b06eb2a808a9 to your computer and use it in GitHub Desktop.
Save pratos/86a3bb07bde32abf8de1b06eb2a808a9 to your computer and use it in GitHub Desktop.
Build a Docker image

Build a docker image

  • Make sure you are in the folder that contains the Dockerfile
  • If your folder is /my-docker-image/, there should be 2 files in your folder:
    /my-docker-image
    |
    |---Dockerfile
    |---requirements.txt
    
  • Run: cd /my-docker-image
  • To build the image, run: docker build -t <image-name>:<version-number> .
  • In the above command, make sure you have a dot[.] at the end of the command included. It means that all the files would be collected and sent to the docker daemon context.
  • Once done, the docker image would be ready on your local system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment