/dockercon-2017

Recap of DockerCon 2017

Primary LanguageGo

DockerCon 2017 Recap

gist

Docker for Developers

Docker Multi Stage builds

At the time of writing, need to install Docker For Mac Edge

Sample application: alexellis2/href-counter

A Golang example application which counts internal vs. external hrefs within a page to rate SEO.

docker run --rm -e url=https://news.ycombinator.com alexellis2/href-counter

Note: Needs internet to get html from url...

Before Multi Stage builds:

Build sdk image

docker build -t alexellis2/href-counter:sdk . -f Dockerfile.build

Look at size of image

docker images |grep href-counter

Size of layers added ~20MB

docker history alexellis2/href-counter:sdk |head -n 4

Use builder pattern:

cat build.sh

Now run old builder pattern

./build.sh

Confirm new final image is much smaller

docker images |grep href-counter

With Multi-stage builds

Instead of using a shell script to orchestrate two separate Dockerfiles, we can just use one and define stages throughout.

cat Dockerfile.multi

Sample Hello world app

cd ../hello
docker build -t hello-world-lab .

Resulting image is very small

docker images |grep hello-world-lab

Confirm image works

docker run --rm hello-world-lab

Desktop to Cloud

Image of Docker Cloud UI

Image of Docker Cloud UI

Image of Resulting AWS Stack

Setting up Docker cloud instructions

Docker For Operators

Overview of all components making up Docker stack.

Highlights:

  • secrets.
  • Node identity, MTLS and encrypted networking
  • LinuxKit
  • Moby

Keynote links

Notes

  • multi-stage builds: bash script was hacky and broke
  • desktop to cloud: giving a user access is as easy as using the docker cloud UI (Created an org, add teams - set team permissions to clusters)
  • Note that the Desktop To Cloud feature configures your DOCKER_HOST to work with the swarm in the cloud.