Wednesday, July 4, 2018

Getting Started with Docker

image

image

image

Swarm

image

image

image

Different tokens are used to join a manager node and a worker node.

image

Very Important: specify the advertise address and listen address

image

To promote a worker node to manager node. Can do this from any manager node.

image

After promoting a worker node to manager node, the Manager Status changed from empty (no value) to ‘Reachable’. Empty/no value means it’s a worker node.

image

Services

Running services in the Swarm

To create service

image

image

image

image

image

image

image

Shut down one of the nodes

image

image

To scale the services

image

image

Docker automatically create new containers and distribute the containers among the availablAte nodes when scaling.

image

Adding new nodes to the Swarm doesn’t cause the Swarm to re-balance the load. * This behavior might change in the future.

To remove service:

image

To create an Overlay network:

image

Create a new service with 12 replicas:

image

To inspect a services:

image

Can add option at docker service create command for service update, i.e. update the task (container) 2 at a time, wait for 10 minutes, then update another 2 tasks (containers).

image

image

To make it easy to read:

image

Stacks and Bundles

image