Skip to content

dockerfile_build_run

M1chaelM edited this page Dec 2, 2020 · 1 revision

Build, run and tag your image

Build the image

To build your image and associate it with an appropriate name, run

  • docker build --tag <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG> .
  • E.g. docker build --tag tylerlum/vorc-competitor-example:v2.2020 .

Notes:

  • The build command above expects to be run from the directory containing the Dockerfile and the scripts you created.
  • The <USERNAME> must match the username of your DockerHub account.
  • The <IMAGE_REPOSITORY_NAME> is the repository name that the image will be saved to on Dockerhub.
  • The tag and colon are optional but very helpful for versioning your images.
  • Depending on your system and the complexity of the Dockerfile, the build process can take a while to complete.
  • Further information about the Docker build command is available in the official Docker Documentation.

Run the image

  • Run docker run <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG> This will create a container with the image you created in the previous step, and then run /run_my_system.bash.