Skip to content
Lucian Cumpata edited this page Jul 25, 2019 · 3 revisions
  • How to build a docker image?

#docker build --tag=name <Dockerfile_source>

If it's in the same directory just type a dot. Example: #docker build --tag=name .

  • How to run a docker image?

When running a docker image you can specify a lot of options.

I will show how to run in detached mode with port forwarding:

#docker run -d --name <name> -p 8080:8080 <image_name>

  • How to access a docker container interactively?

#docker exec -it <container_id/container_name> <program_to_execute>

Ex: sudo docker exec -it postgreSQL /bin/bash

Clone this wiki locally