Module 41
Module 41
Docker - II
Docker Bind
Volumes Mounts
Syntax
Bind Mounts
Syntax
Bind Mounts
Syntax
Bind Mounts
Once you link containers, they can reach out to others using their names.
Syntax
1. Create two containers of Ubuntu with names as follows: container1 and container2
3. Try pinging from container2 to container1 by just using the command “ping container1”
Notifications Ma i l Pa yments
Ma i l
Notifications Pa yments
Loca tion
Servi ces
Ma i l
Notifications Pa yments
Loca tion
Servi ces
Compose is a tool for defining and running multi-container Docker applications. With Compose,
you use a YAML file to configure your application's services. Then, with a single command, you
create and start all the services from your configuration. Run docker-compose up
and compose starts and runs your entire app.
docker-compose --version
YAML is a superset of a JSON file. There are only two types of structures in YAML which
you need to know to get started:
Maps
Lists
Maps
<key> : <value>
Name: Intellipaat
Course: Devops
Maps Args
- arg 1
- arg 2
- arg 3
version: '3'
services:
sample1:
image: httpd
ports:
- “80:80"
sample2:
image: nginx
docker-compose up -d
docker-compose up -d
Applications are typically made up of individually containerized components (often called microservices)
that must be organized at the networking level in order for the application to run as intended. The process
of organizing multiple containers in this manner is known as container orchestration.
Leader
Containers on the cluster are deployed using services on Docker Swarm. A service is a long-
running Docker container that can be deployed to any node worker.
Service
Service
Let’s take an example. Say, there are two containers which we deploy in the docker ecosystem.
Therefore, in-order to have interactions between Docker Containers, we need Docker Networks.
Docker Network
© Copyright 2019 IntelliPaat, All rights reserved
What are Docker Networks?
One of the reasons Docker containers and services are so powerful is that you can
connect them together or connect them to non-Docker workloads. And, this can be
accomplished using Docker Networks.
macvlan none
host The default network driver. If you don’t specify a driver, this is
the type of network you are creating. Bridge networks are
usually used when your applications run in standalone
overlay containers that need to communicate.
macvlan
none
macvlan
none
macvlan
none
macvlan
none
bridge None
host
For this container, disable all networking. This is
usually used in conjunction with a custom network
driver. And, none is not available for swarm services.
overlay
macvlan
none
A. Docker File
C. Docker Network
D. None of these
A. Docker File
C. Docker Networks
D. None of these
A. Docker Volumes
B. Bind Mounts
C. Docker Network
D. None of these
A. Docker Volumes
B. Bind Mounts
C. Docker Network
D. None of these
3. For Building a Microservices Architecture, which of the following should you choose?
A. Docker Compose
B. Docker Volumes
C. Docker Swarm
D. None of these
3. For Building a Microservices Architecture, which of the following should you choose?
A. Docker Compose
B. Docker Volumes
C. Docker Swarm
D. None of these
4. The Docker Volume of type local is available throughout the swarm cluster.
A. True
B. False
4. The Docker Volume of type local is available throughout the swarm cluster.
A. True
B. False
A. True
B. False
A. True
B. False