Docker Basics Flashcards
Command to get docker version
docker –version
What is docker hub
- Docker hub is a public docker registry at hub.docker.com
- anyone can access these images
route to find docker image registries in docker hub
- http://hub.docker/r/{ imagename }
- registries hold repositories.
- repository:version
How to specify the port in a docker run
- docker run -p { port1 }:{ port2 }
- docker run -p { 5000 }:{ 5000 }
- -p is short for publish.
What is it called when an image is running?
a container
What is the bridge network
Internal docker network. All containers run inside the bridge network. You cannot access the container unless the container is exposed to the outside.
What is the first port and second port of a specified docker container. EX: 5000:5000
The first port number is a host port and the second is the container port
How to launch docker container detached from the command line
add a { -d } to the docker run command
command to print out logs
docker logs { container id/name }
how to follow the logs of a docker container
-f
exL docker logs -f { container id/name }
How to list out images created
docker images
how to list all the running containers
docker container ls
how to follow the logs of a docker container
-f
ex: docker logs -f { container id/name }
what option allows you to list out all the docker containers. Even the ones that have been exited
-a
docker container ls -a
What is the docker Client?
Docker client takes our commands and sends them to the docker daemon.
- It pulls images
- Manages your containers
- pushes images to the repository