Docker Associate Certification Flashcards
Flash Cards for the Docker Associate Certification
What lists all available/configured Docker networks?
docker network ls
What performs a Docker service create?
- no volume (–volume or -v)
- –mount [source=/path],target=[path]
What is the docker swarm unlock-key --rotate
command for?
It performs a key rotation for security on a regular basis.
How do you export the image ‘httpd:latest’ to a tar file called ‘httpd-latest.tar’?
docker save -o httpd-latest.tar httpd:latest
What is the Docker command to run a ‘hello-world’ image from the default repository?
docker run hello-world
What is the command to allow you to log in with the specified username to a remote image repository?
docker login –username=[USERNAME]
What is the directive within a Dockerfile that creates a mount point inside instantiated containers that can be used to mount external volumes?
VOLUME
What is the command to list all running swarms in your configuration?
docker swarm ls
How do you update a previously draining and/or removed node from the swarm cluster?
docker node update –availability active [NODE ID]
from master
What command stops a ‘stuck’ or ‘frozen’ container called ‘myweb’?
docker kill myweb
What is the command that lists the services running in your swarm cluster?
docker service ls
What’s the command to scale the number of instances in your swarm cluster, once the service is already running/deployed?
docker service scale [SERVICE NAME]=[NUMBER]
What demotes a ‘master’ or ‘manager’ node to a ‘follower’ node?
docker node demote [NODE ID]
What command promotes a ‘follower’ node to ‘master’ or ‘manager’?
docker node promote [NODE ID]
How do you create a Docker image from a Dockerfile in the current directory, naming the image ‘myimage:v1’?
docker build -t myimage:v1
What is the command to create a new Docker network for containers to use called ‘mynet’?
docker network create –subnet [RANGE] mynet
What command stops a running container called ‘myweb’ 10 seconds after executing the request?
docker stop -t 10 myweb
How do you find the Docker management token?
docker swarm
- join-token manager (to add another manager, following prompts)
What is the command to remove a service from your swarm cluster?
docker service rm [SERVICE NAME]
What is the directive in a Dockerfile that indicates the default command to run in instantiated containers unless overridden at launch time?
ENTRYPOINT
How do you perform a Docker swarm manager setup?
docker swarm
> init –advertise-addr [ip address of manager]
How do you create a service called ‘my_example’ with 4 replicas from the indicated image?
docker service create –name my_example –replicas 4 [IMAGE SERVICE]
What do you use to gracefully remove a node from a swarm cluster?
docker swarm leave (on the node to remove)