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...
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
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
- Docker Cloud UI (takes about 10min)
- AWS Stacks
Setting up Docker cloud instructions
Overview of all components making up Docker stack.
Highlights:
- secrets.
- Node identity, MTLS and encrypted networking
- LinuxKit
- Moby
- 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 yourDOCKER_HOST
to work with the swarm in the cloud.