4. Life Before Docker
➔Why the installation note does not work on
their laptop/server? It’s their fault!
➔Production server busted? Go back to
installation note.
5. VM?
➔How can you move it to production? Without
rebuilding the image?
➔Can you run multiple instance using the
same image? Without duplicating?
➔Shit, I just broke the image. Can we use the
previous version? No rebuilding?
➔Can we make it slim? Like just 200MB for
nginx stack?
6. “an open-source project that automates the
deployment of applications inside software
containers, by providing an additional layer of
abstraction and automation of operating
system–level virtualization on Linux.”
Docker is
7. Share more resource with host
✓ Lightweight
Ship the image anywhere (Linux ;)
✓ Portable
Tag the image for archiving
✓ Versioning friendly
Build on top other
✓ Stackable
10. Dockerfile #2
FROM nginx
ADD html /usr/share/nginx/html
$ docker build -t rtl-nginx-2 .
$ docker kill <pid>
$ docker run -d -p 80:80 rtl-nginx-2
$ open http://172.16.42.43
11. Dockerfile #3
FROM nginx
# stale content bug on Nginx x Vagrant x Mac OSX
RUN sed -i -e "s/sendfile.*/sendfile off;/g"
/etc/nginx/nginx.conf
$ docker run -d -p 80:80 -v
htdocs/RTL/nginx/html:/usr/share/nginx/html
rtl-nginx
$ open http://172.16.42.43
12. Docker implementation
1. Base image
a. Start with minimal stack
b. Mimic production as much as you can
c. Leave third party service alone
2. Dev image
a. Add build-tools
b. Add testing-tools: selenium, vnc
3. Deployable-image
a. Add third party services: newrelic, etc
b. Finalize config
13. Dev Workflow
➔Setup
◆ Virtual Box + Vagrant
◆ boot2docker
◆ docker-osx (directory mapping reason), alt
boot2docker
➔Checkout dev image
➔Mess with code
➔Run tests
➔Commit and push
18. Production Env
➔Elastic Beanstalk
◆ using .ebextensions scripts to setup EC2 instance
◆ Newrelic for server monitoring
◆ Splunk for logging
➔Manual deployment
◆ i-am-not-so-sure environment
◆ fvck-it-ship-it enviroment
19. Next, The Holy Grail
12 Factors App
http://12factor.net
➔Disposability (stateless)
◆ started or stopped at a moment’s notice
➔Config (via ENV vars)
◆ app’s config varies between dev, staging, production
➔Every setup is different. YMMV.
Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating system–level virtualization on Linux.
Lightweight:
shares more resources with its host
Can be shipped with whale
“A full virtualized system gets its own set of resources allocated to it, and does minimal sharing. You get more isolation, but it is much heavier (requires more resources).”