- Dockerfile builds an image
- A container is started from that image
- Multiple containers can be started and running simultaneously from a single image
- enter a docker bash session
- use
docker ps -a
to see all containers - get
NAME
of desired container - enter the bash session
docker exec -t -i <container name> /bin/bash
- use
- another way to enter bash session
docker-compose exec <container name sh
- third way to enter a bash session
docker-compose run <containter name> bash
docker ps
- shows all running containers
docker ps -a
- shows all containers, running or not
docker inspect --format "{{.State.Running}}" wp
wp
is name of container- shows boolean if container is running
docker logs <container name>
docker stop $(docker ps -a -q)
- stop all running containers
docker image prune
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes