9. • Leader:
docker swarm init
• Copy tokens:
docker swarm join-token worker
• Other nodes:
docker swarm join -token <token> <IP:PORT>
Creating a Swarm
Business as usual
10. • Server with swarm description
• Startup container → pull config
• Init swarm → store tokens
• Join swarm
Reference scenario: plug and play
Provisioning
Bootstrapping a swarm
11. • Leave out the clutter
• Limited storage
• Save bandwidth
Compact Images
Multi-stage builds
12. FROM golang:1.8 as build
WORKDIR /go/src/humidity-sensor
COPY main.go ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
-ldflags '-extldflags "-static"' -installsuffix cgo -o app .
FROM scratch
COPY --from=build /go/src/humidity-sensor/app /humidity
COPY --from=build /etc/ssl/certs/ /etc/ssl/certs
CMD ["/humidity"]
Multi-Stage Dockerfile
13. • Multiple images under single name
• Supported by Docker Swarm
• Abstract host heterogeneity
Reference scenario: different models of weather station
Multiple Architectures
Fat manifests