Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Whether you are a DevOps beginner or just a developer who wants to start working with containers, you’re in the right place. Docker is an in-demand technology that you will be exposed to frequently while on the job.
Docker is used for setting up, deploying, and running applications, at scale, by containerizing them. More on that later. Docker also provides developers with a consistent environment for product development, and along with Kubernetes, makes managing the development lifecycle a breeze.
In this course, you will learn the fundamentals of Docker such as containers, images, and commands. You’ll then progress to more advanced concepts like connecting to a database container and how to simplify workflows with Docker Compose. At the end, you’ll learn how to monitor clusters and scale Docker services with Swarm.
Q1. How do you map a host port to the container port?
Q2. Which keyword is used to set environment variables in Dockerfile?
Q3. Select all the commands used to see logs of the container.
Q4. What is the use of lsof -i TCP:5000
command?
Q5. In docker build .
command, what does .
stands for?
.
means current directory.Q1. Where is the list of the current reachable hosts/containers to a container located?
docker inspect <network ID>
command outputdocker inspect <container-id>
command output.Q2. What is the drawback of default bridge network?
Q3. How to pass environment varibles while creating a container from prebuilt Image?
-e
option while creating a docker container.--environ
option.Q4. What command is used to check details of a network?
docker network --info <network-id>
docker network ls
docker inspect <networkID>
Q5. What is the use of docker-compose?
Q1. Select all the options which can be used to provide environment variables to a container in docker-compose.yml file.
- env_file
- environment
- env
ENV
Q2. How to run docker-compose in detached mode or in the background?
--daemon
flag with docker-compose up
command.-d
option with docker-compose up
command.docker-compose run --background
command.Q3. Which commands can be used insted of docker-compose up
?
docker-compose build
and docker-compose start
docker-compose build
and docker-compose run
docker-compose start
and docker-compose run
Q4. How to specify location of Dockerfile in case of multiple Dockerfiles or to use Dockerfile located in different location?
context
and dockerfile
keywords under build
sectiondockerfile
option and provide absolute path to the dockerfile.directory
option under build
section with dockerfile
.Q1. Select all the options which applies to the Docker Swarm
Q2. Which type of docker network is used to establish communication between different services?
Q3. What is the right command to scale down a service running with 6 containers to 3 containers?
docker service <service_id> scale down 3
docker service scale <service_id>=3
docker services scale <service_id>=3
docker service <service_id> scale=3
Q4. How to list all the running containers or tasks of a stack?
docker stack ls
docker stack ps <stack_name>
docker stack services ps
Q5. Can you use build
keyword in docker-compose.yml file while working on a swarm node?
I hope this Working with Containers: Docker & Docker Compose Educative Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>