Congrats! You and your coworkers love Docker. Docker has become an increasingly helpful tool when it comes to DevOps. We can now build smaller, more robust local development setups with the promise of mirroring production. One thing that still plagues many situations is how to get those containers into production and update them over time. We'll explore different tools for setting up, configuring, and maintaining containers as they go live.
16. Start Small
• Build your application
• Run composer
• Run npm/bower
• Build JS/CSS
• Use the compiled output to build an image with docker build
• Push full image to private registry
ZendCon, October 2016 16
17. docker build
• Additional options to look at
• -f, --file – Specify a different filename for the Dockerfile
• --no-cache – Don’t use a cached layer
• --pull – Always pull a new version of the image
ZendCon, October 2016 17
24. Switch to the remote node
• Run docker-machine env zendcon2016
& "C:Program
FilesDockerDockerResourcesbindocker-
machine.exe" env zendcon2016 | Invoke-Expression
ZendCon, October 2016 24
25. Set up docker-compose
• Docker Compose allows multiple config files with -f
• Have a base docker-compose.yml for Production
• Add a secondary one for Development
ZendCon, October 2016 25
29. When doing a deployment
docker-compose up -d
ZendCon, October 2016 29
30. Other Alternative – Variable Substitution
• Docker Compose allows variable substitution inside the file
• Wrap variables in ${}
• image: ${DEPLOY_VERSION}_php
ZendCon, October 2016 30
31. When doing a deployment
docker build –f […] –t 20161010_php /opt/builds/20161010
DEPLOY_VERSION=20161010 docker-compose up -d
ZendCon, October 2016 31
48. What is it?
• Rancher has an API!
• Small executable that interacts with Rancher API
• Kind of like a custom docker-compose
Daycamp 4 Developers - Ops for Devs 48
49. Get an API Key
Daycamp 4 Developers - Ops for Devs 49
50. Get an API Key
Daycamp 4 Developers - Ops for Devs 50