Docker Cookbook


| Chapter 3: Docker Networking



Download 6,31 Mb.
Pdf ko'rish
bet94/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   90   91   92   93   94   95   96   97   ...   260
Bog'liq
Docker Cookbook

104 | Chapter 3: Docker Networking


6635a3822135
8805e22ad6e2
The two namespace IDs returned are the ones of the running container on that host
and the overlay network the container is in:
root@net-2:/var/run/docker# ip netns exec 6635a3822135 ip addr show eth0
15: eth0: mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:b3:91:22:c3 brd ff:ff:ff:ff:ff:ff
inet 172.21.0.5/16 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::42:b3ff:fe91:22c3/64 scope link
valid_lft forever preferred_lft forever
You get back the network interface of your running container, with the same MAC
address, and the same IP. If you check the links of the overlay namespace, you see
your VXLAN interface and the VLAN ID being used:
root@net-2:/var/run/docker# ip netns exec 8805e22ad6e2 ip -d link show
......
14: vxlan1: mtu 1500 qdisc noqueue master br0 state \
UNKNOWN mode DEFAULT group default
link/ether 7a:af:20:ee:e3:81 brd ff:ff:ff:ff:ff:ff promiscuity 1
vxlan id 256 srcport 32768 61000 dstport 8472 proxy l2miss l3miss ageing 300
bridge_slave
16: veth2: mtu 1500 qdisc pfifo_fast master br0 state \
UP mode DEFAULT group default qlen 1000
link/ether 46:b1:e2:5c:48:a8 brd ff:ff:ff:ff:ff:ff promiscuity 1
veth
bridge_slave
If you sniff packets on these interfaces, you will see the traffic between your
containers.
3.15 Diving Deeper into the Docker Network Namespaces Configuration | 105



CHAPTER 4
Docker Configuration and Development
4.0 Introduction
If you have read all the chapters so far, you have learned all the basics of using
Docker. You can install the Docker engine, start and manage containers, create and
share images, and you have a good understanding of container networking including
networking across multiple hosts. This chapter will now look at more advanced
Docker topics, first for developers and then for configuration.
Recipe 4.1
 looks at how to configure the Docker engine, then 
Recipe 4.2
 shows how
to compile Docker from source. 
Recipe 4.3
 presents how to run all the tests to verify
your build and 
Recipe 4.4
 shows how to use this newly built binary instead of the
official released Docker engine.
Developers might also want to look at the 
nsenter
utility in 
Recipe 4.5
. While not
needed for using Docker, it is of use to better understand how Docker leverages Linux
namespaces to create containers. 
Recipe 4.6
is a sneak peek at the underlying library
used to managed containers. Originally called libcontainer, 
runc
has been donated to
the Open Container Initiative to be the seed source code to help drive a standard for
container runtime and image format.
To dive deeper into configuration and how to access the Docker engine, 
Recipe 4.7
presents how to access Docker remotely and 
Recipe 4.8
introduces the application
programming interface (API) exposed by Docker. The Docker client uses this API to
manage containers. Accessing this API remotely and securely is described in 
Recipe
4.9
, it shows how to set up TLS-based access to the Docker engine. To finish the con‐
figuration topics, 
Recipe 4.12
shows how to change the underlying storage driver that
provides a union filesystem to support Docker images.
107


If you are a user of Docker, you will benefit from looking at 
Recipe 4.10
and 
Recipe
4.11
. These two recipes present 
docker-py
, a Python module to communicate with
the Docker API. This is not the only client library available for Docker, but it pro‐
vides an easy entrypoint to learn the API.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   90   91   92   93   94   95   96   97   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish