Skip to content

Instantly share code, notes, and snippets.

@moronkreacionz
Last active August 28, 2018 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moronkreacionz/2a298aa0aa90cb7df050c5e4dceba43e to your computer and use it in GitHub Desktop.
Save moronkreacionz/2a298aa0aa90cb7df050c5e4dceba43e to your computer and use it in GitHub Desktop.
Steps to 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-name/`, these 3 files should be in your folder:
...
/my-docker-image
|
|---Dockerfile
|---Readme.md
|---requirements.txt
...
- Run: `cd /my-docker-image-name`
- To build the image, run: `docker build -t <image-name>:<version-number> .`
- The above command ensure 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.
- Done, the docker image would take time to build, once done, it is ready on your local system.
- You can push the Docker image to Docker Hub for public access or reuse as a docker image.
Note: Steps on guidance for creating Dockerfile seperately posted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment