Docker-commands & terminology Flashcards
delete all stopped containers.
docker rm $(docker ps -a -q)
remove a docker image
docker rmi [image name]
delete all docker images
docker rmi $(docker images -q)
log into a running docker container.
sudo docker exec -it [container name] bash
show running docker containers
docker ps
run a docker container
docker run [image name]
see the logs of a docker container
docker logs [container name]
build a docker image
docker build -t [tag name] .
stop a running container.
docker stop [container name]
list all images
docker images
run a container and map it to a host port.
docker run -p 8082:8082 [image name]
remove a stopped container
docker rm [container name]
what is a docker image?
a lightweight standalone, executable package that includes everything needed to run a piece of software.
what is a docker container?
a runtime instance of a docker image.
what is a Dockerfile?
A text document that contains all the commands a user could call on the command line to assemble an image.