Docker Container
Table of contents
Show running containers
docker ps
Execute command in container
docker exec -it my-container <command>
Open a container shell
docker exec -it my-container sh
Start an existing container in background (detached)
The container will run in background and you will not see its stdout
/stderr
docker start my-container
Attach container
If you want to see outputs from the container in your terminal (ie. logging), you would want to run the container in attached mode.
You can either run it in attached mode to begin with by
docker start my-container --attach
# OR
docker start my-container -a
Or you can attach a running container later
docker attach my-container