Docker - LucianCumpata/DevOps GitHub Wiki

  • 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

  • How to peak at a container output strea?

#docker attach --sig-proxy=false <container_name>

⚠️ **GitHub.com Fallback** ⚠️