5. Docker What ?
#DockerNet
@hsissouimad
• Open Source engine to commoditize Linux Containers
(known as LXC)
• LXC (LinuX Containers) let you run a Linux system
within another Linux system
• A container is a group of processes on a Linux box,
put together in an isolated environment
• Inside the box, it looks like a VM.
Outside the box, it looks like normal processes.
18. docker run –it alpine sh (again)
#DockerNet
@hsissouimad
19. Container perspective
#DockerNet
@hsissouimad
root@devoxx-ma:~# docker run -it alpine sh
/ # ip a
<Snip>
5: eth0@if6: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu
1500 qdisc noqueue state UP
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.2/16 scope global eth0
valid_lft forever preferred_lft forever
<Snip>
CTRL + PQ to detach
34. docker network ls (before swarm)
#DockerNet
@hsissouimad
root@devoxx-ma-node1:~# docker network ls
NETWORK ID NAME DRIVER SCOPE
48422e8a759a bridge bridge local
bc11ca59e46c host host local
58058e6fe378 none null local
35. docker swarm init
#DockerNet
@hsissouimad
root@devoxx-ma-node1:~# docker swarm init
Swarm initialized: current node (xavrlc61fi83zdhxb51p55xmy) is
now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-
5mosmewivdfjtym5evqyumqulqvptqiiq6udt394ubvfiuqgr1-
5j0w7wtqe0az060mtqqcjwghc 138.68.165.47:2377
36. docker swarm init --advertise-addr
#DockerNet
@hsissouimad
root@devoxx-ma-node1:~# docker swarm init --
advertise-addr 138.68.165.47:2377
Swarm initialized: current node (xavrlc61fi83zdhxb51p55xmy) is
now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-
5mosmewivdfjtym5evqyumqulqvptqiiq6udt394ubvfiuqgr1-
5j0w7wtqe0az060mtqqcjwghc 138.68.165.47:2377
37. docker swarm join --token (Node 2)
#DockerNet
@hsissouimad
root@devoxx-ma-node2:~# docker swarm join
--token SWMTKN-1-5mosmewiv5evq4u
138.68.165.47:2377
This node joined a swarm as a worker.
39. docker network ls (after swarm)
#DockerNet
@hsissouimad
root@devoxx-ma-node1:~# docker network ls
NETWORK ID NAME DRIVER SCOPE
c1d369da0672 bridge bridge local
ae21837a0f3f docker_gwbridge bridge local
4fd7f5302ddf host host local
b9o4m4tdhsnm ingress overlay swarm
5f80a2dd1f15 none null local