SlideShare una empresa de Scribd logo
1 de 20
Life before Docker
Take notes of what you install and uninstall on
the server
Life before Docker
Pass along the
installation note
when someone want
to copy the setting
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.
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?
“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
Share more resource with host
✓ Lightweight
Ship the image anywhere (Linux ;)
✓ Portable
Tag the image for archiving
✓ Versioning friendly
Build on top other
✓ Stackable
ASCII Demo
https://asciinema.org/a/14255
Dockerfile
FROM nginx
$ docker build -t rtl-nginx .
$ docker run -d -p 80:80 rtl-nginx
$ open http://172.16.42.43
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
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
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
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
Continuous Integration cont.
➔Devs push code
➔Jenkins runs tests
➔Not OK?
◆ Complain in Hipchat
➔All OK?
◆ Build deployable-image
◆ Push image into private registry
◆ Notify devs on Hipchat
Staging
➔Jenkins runs tests on trunk
➔Build staging image
➔Push staging image to private registry
➔Tell Ansible to reload staging
Staging Env
Staging Env cont.
➔using Fig (http://fig.sh)
➔Images:
◆ web apps
◆ reverse-proxy (https://github.com/jwilder/nginx-
proxy)
➔Flow (via Ansible)
◆ pull latest image
◆ restart web app instance
◆ reverse-proxy reloads itself
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
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.com/tryit
linkedin.com/in/neofreko
akhmadf@gmail.com
@neofreko

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Docker dev, test & production (afas)
Docker  dev, test & production (afas)Docker  dev, test & production (afas)
Docker dev, test & production (afas)
 
Developer South Coast 2018: Modernizing .NET Apps with Docker
Developer South Coast 2018: Modernizing .NET Apps with DockerDeveloper South Coast 2018: Modernizing .NET Apps with Docker
Developer South Coast 2018: Modernizing .NET Apps with Docker
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage build
 
Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13
 
Docker as development environment
Docker as development environmentDocker as development environment
Docker as development environment
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
CI CD WORKFLOW
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
 
vodQA(Pune) 2018 - Docker in Testing
vodQA(Pune) 2018 - Docker in TestingvodQA(Pune) 2018 - Docker in Testing
vodQA(Pune) 2018 - Docker in Testing
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Zalenium - SeleniumConf Austin 2017
Zalenium - SeleniumConf Austin 2017Zalenium - SeleniumConf Austin 2017
Zalenium - SeleniumConf Austin 2017
 
Developer South Coast 2018: Docker on Windows - The Beginner's Guide
Developer South Coast 2018: Docker on Windows - The Beginner's GuideDeveloper South Coast 2018: Docker on Windows - The Beginner's Guide
Developer South Coast 2018: Docker on Windows - The Beginner's Guide
 
Webinar: Development Swarm Cluster with Docker Compose V3
Webinar: Development Swarm Cluster with Docker Compose V3Webinar: Development Swarm Cluster with Docker Compose V3
Webinar: Development Swarm Cluster with Docker Compose V3
 
Docker for Developers - Part 1 by David Gageot
Docker for Developers - Part 1 by David GageotDocker for Developers - Part 1 by David Gageot
Docker for Developers - Part 1 by David Gageot
 
CI/CD Pipeline with Docker
CI/CD Pipeline with DockerCI/CD Pipeline with Docker
CI/CD Pipeline with Docker
 

Similar a Docker at Monoco.jp (LinkedIn)

Similar a Docker at Monoco.jp (LinkedIn) (20)

Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
Docker In Brief
Docker In BriefDocker In Brief
Docker In Brief
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Docker 101
Docker 101 Docker 101
Docker 101
 
Docker engine - Indroduc
Docker engine - IndroducDocker engine - Indroduc
Docker engine - Indroduc
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
 

Docker at Monoco.jp (LinkedIn)

  • 1.
  • 2. Life before Docker Take notes of what you install and uninstall on the server
  • 3. Life before Docker Pass along the installation note when someone want to copy the setting
  • 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
  • 9. Dockerfile FROM nginx $ docker build -t rtl-nginx . $ docker run -d -p 80:80 rtl-nginx $ open http://172.16.42.43
  • 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
  • 14. Continuous Integration cont. ➔Devs push code ➔Jenkins runs tests ➔Not OK? ◆ Complain in Hipchat ➔All OK? ◆ Build deployable-image ◆ Push image into private registry ◆ Notify devs on Hipchat
  • 15. Staging ➔Jenkins runs tests on trunk ➔Build staging image ➔Push staging image to private registry ➔Tell Ansible to reload staging
  • 17. Staging Env cont. ➔using Fig (http://fig.sh) ➔Images: ◆ web apps ◆ reverse-proxy (https://github.com/jwilder/nginx- proxy) ➔Flow (via Ansible) ◆ pull latest image ◆ restart web app instance ◆ reverse-proxy reloads itself
  • 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.

Notas del editor

  1. 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.
  2. 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).”
  3. cd hdocs/RTL/nginx
  4. http://stackoverflow.com/questions/9866106/nginx-on-virtualbox-ubuntu-guest-serves-stale-content?lq=1