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.
create a volume
docker volume create [volume name]
what is a docker daemon?
listens for docker API requests and manages docker objects such as images, containers, networks and volumes.
what is docker?
a tool that allows you to create, deploy and run applications by using containers.
describe the docker architecture
docker client: ie commands that you run on the cli, the client and daemon communicate using a REST API
docker daemon: the docker daemon (dockerd) listens for docker API requests and manages docker objects.
docker registry: stores docker images.