SlideShare a Scribd company logo
1 of 15
Download to read offline
Docker 101
From production to development
Raül Pérez <repejota@gmail.com>
Who am I?
Raül Pérez
@repejota
https://github.com/repejota
https://www.linkedin.com/in/repejota
Lead Software Engineer at @Carrenza
● Managing a small team remotely
from Barcelona.
● Working with DevOPS stuff.
● Still more a dev than an OP.
● Proud to be a #Gopher but I’ve
coded on a bunch of different
languages.
Raül Pérez 20/01/2016
What is Docker?
Docker is a tool:
● Based on the original LXC.
● Helps you to containerize your app.
● Handles network between
containers.
● Handles volumes between
containers.
Raül Pérez 20/01/2016
What is not Docker?
● Docker are not Virtual Machines!!
● Docker does not offer a single way
to do things:
○ Offers a powerful CLI
○ There is always more than one way to
do the same.
○ Build workflows, adapt it to your existing
pipeline.
Raül Pérez 20/01/2016
Docker: Many tools in one
docker
● Main tool.
● Handles containers.
docker-compose
● Orchestrate containers.
docker-machine
● Manage servers ( remote or local ).
Raül Pérez 20/01/2016
Docker: docker
● Handles building containers.
● Handles building images.
● Handles running containers.
● ....
● It does not orchestrate.
● It does not help during the
development process.
Raül Pérez 20/01/2016
Docker: docker-compose
● It orchestrates containers.
● Handles show each container
connects to other ones.
Raül Pérez 20/01/2016
Docker: docker-machine
● Manages remote servers
● Manages virtual machines (
Vagrant )
Raül Pérez 20/01/2016
How to use Docker?
Production:
● Uses images
● hub.docker.com
● Everything is built.
● Everything is compiled.
● EASY!
Development:
● Uses the code itself.
● Nothing is build or compiled.
● HARD!
https://github.com/hurrabox
Raül Pérez 20/01/2016
How to use Docker? : production
● docker-compose.yml
● 5 containers
○ database
○ redis
○ api
○ front
○ nginx
● This is for production
○ It builds from images
db:
image: postgres
redis:
image: redis
api:
restart: always
image: ulabox/api:latest
links:
- redis
- db
front:
restart: always
image: ulabox/front:latest
links:
- redis
- db
nginx:
restart: always
image: ulabox/nginx:latest
ports:
- "80:80"
links:
- front
- api
Raül Pérez 20/01/2016
How to use Docker? : development
● docker-compose-dev.yml
● 5 containers
○ database
○ redis
○ api
○ front
○ nginx
● This is for development
○ It builds from source code
api:
build: ./repos/api
volumes:
- ./repos/api:/src
front:
build: ./repos/front
volumes:
- ./repos/front:/src
nginx:
build: ./repos/nginx
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
Raül Pérez 20/01/2016
How to use Docker?
docker-compose -f docker-compose.yml -f dev.yml up -d
● Uses docker composition of services
https://docs.docker.com/compose/extends/
● First use docker-compose.yml
● Second ‘extend’ the service overriding fields with dev.yml
● Do not worry anymore about how to link prod & dev, you just got it. :)
Raül Pérez 20/01/2016
How to use Docker? Workflow
● Yes but, how do i work on a
component of my service?
○ Do I need a shared folder?
○ Do I need to ssh to to the container?
○ How can i change/build/restart?
● Well there is no a perfect solution
for this … yet.
Raül Pérez 20/01/2016
How to use Docker?
docker-compose -f docker-compose.yml -f dev.yml run <service> <cmd> --service-ports
● Service ports allows you to read dependencies and start the related
containers of the one you choose.
● It executes also CMD overriding the default command.
● You can use it like the normal docker CLI to start a container and expose a
path as a volume.
Raül Pérez 20/01/2016
Thanks!
Questions?

More Related Content

What's hot

Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Publicis Sapient Engineering
 
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!DrupalCamp Kyiv
 
How to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevHow to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevOleksii Bogush
 
The Self-Service Developer - GOTOCon CPH
The Self-Service Developer - GOTOCon CPHThe Self-Service Developer - GOTOCon CPH
The Self-Service Developer - GOTOCon CPHLaszlo Fogas
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Dronetdc-globalcode
 
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...sangam biradar
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChang W. Doh
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsJoseph Lust
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & DockerJoerg Henning
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshotssimonscholz
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientMayflower GmbH
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CIColCh
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMtakezoe
 
Deploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub ActionsDeploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub ActionsDigitalOcean
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentJirayut Nimsaeng
 

What's hot (20)

Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
 
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
 
How to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevHow to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparev
 
The Self-Service Developer - GOTOCon CPH
The Self-Service Developer - GOTOCon CPHThe Self-Service Developer - GOTOCon CPH
The Self-Service Developer - GOTOCon CPH
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
 
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
funcs, func expressions, closure, returning funcs, recursion, the stack -goph...
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Serverless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOpsServerless Preview Environments @ Boston DevOps
Serverless Preview Environments @ Boston DevOps
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
 
Arquitecturas de microservicios - Codemotion 2014
Arquitecturas de microservicios  -  Codemotion 2014Arquitecturas de microservicios  -  Codemotion 2014
Arquitecturas de microservicios - Codemotion 2014
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
 
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshotsEclipse Buildship DemoCamp Hamburg (June 2015)  with additional screenshots
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
CI CD WORKFLOW
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVM
 
Deploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub ActionsDeploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub Actions
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
 

Similar to Docker 101 - From production to development

Docker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentDocker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentWebsolutions Agency
 
From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016Chris Tankersley
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with dockerMaciej Lukianski
 
Docker for developers
Docker for developersDocker for developers
Docker for developersDrupalDay
 
Docker for developers
Docker for developersDocker for developers
Docker for developerssparkfabrik
 
Work shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemWork shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemJoão Pedro Harbs
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Containers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the EnterpriseContainers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the EnterpriseHonza Horák
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowvaluebound
 
Be a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the TradeBe a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the TradeDocker, Inc.
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and YouBalaBit
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tipsSamuel Chow
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Be a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the tradeBe a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the tradeNicola Paolucci
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developersSuraj Deshmukh
 
Bgoug 2019.11 building free, open-source, plsql products in cloud
Bgoug 2019.11   building free, open-source, plsql products in cloudBgoug 2019.11   building free, open-source, plsql products in cloud
Bgoug 2019.11 building free, open-source, plsql products in cloudJacek Gebal
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local developmentAdam Štipák
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Dockerkanedafromparis
 

Similar to Docker 101 - From production to development (20)

Docker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentDocker4Drupal 2.1 for Development
Docker4Drupal 2.1 for Development
 
From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Work shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystemWork shop - an introduction to the docker ecosystem
Work shop - an introduction to the docker ecosystem
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Containers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the EnterpriseContainers Roadshow: How to Develop Containers for the Enterprise
Containers Roadshow: How to Develop Containers for the Enterprise
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflow
 
Be a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the TradeBe a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the Trade
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Be a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the tradeBe a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the trade
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
 
Bgoug 2019.11 building free, open-source, plsql products in cloud
Bgoug 2019.11   building free, open-source, plsql products in cloudBgoug 2019.11   building free, open-source, plsql products in cloud
Bgoug 2019.11 building free, open-source, plsql products in cloud
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local development
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 
Migration from drupal 7 to drupal 8
Migration from drupal 7 to drupal 8Migration from drupal 7 to drupal 8
Migration from drupal 7 to drupal 8
 
Migration from drupal 7 to drupal 8
Migration from drupal 7 to drupal 8Migration from drupal 7 to drupal 8
Migration from drupal 7 to drupal 8
 

Docker 101 - From production to development

  • 1. Docker 101 From production to development Raül Pérez <repejota@gmail.com>
  • 2. Who am I? Raül Pérez @repejota https://github.com/repejota https://www.linkedin.com/in/repejota Lead Software Engineer at @Carrenza ● Managing a small team remotely from Barcelona. ● Working with DevOPS stuff. ● Still more a dev than an OP. ● Proud to be a #Gopher but I’ve coded on a bunch of different languages. Raül Pérez 20/01/2016
  • 3. What is Docker? Docker is a tool: ● Based on the original LXC. ● Helps you to containerize your app. ● Handles network between containers. ● Handles volumes between containers. Raül Pérez 20/01/2016
  • 4. What is not Docker? ● Docker are not Virtual Machines!! ● Docker does not offer a single way to do things: ○ Offers a powerful CLI ○ There is always more than one way to do the same. ○ Build workflows, adapt it to your existing pipeline. Raül Pérez 20/01/2016
  • 5. Docker: Many tools in one docker ● Main tool. ● Handles containers. docker-compose ● Orchestrate containers. docker-machine ● Manage servers ( remote or local ). Raül Pérez 20/01/2016
  • 6. Docker: docker ● Handles building containers. ● Handles building images. ● Handles running containers. ● .... ● It does not orchestrate. ● It does not help during the development process. Raül Pérez 20/01/2016
  • 7. Docker: docker-compose ● It orchestrates containers. ● Handles show each container connects to other ones. Raül Pérez 20/01/2016
  • 8. Docker: docker-machine ● Manages remote servers ● Manages virtual machines ( Vagrant ) Raül Pérez 20/01/2016
  • 9. How to use Docker? Production: ● Uses images ● hub.docker.com ● Everything is built. ● Everything is compiled. ● EASY! Development: ● Uses the code itself. ● Nothing is build or compiled. ● HARD! https://github.com/hurrabox Raül Pérez 20/01/2016
  • 10. How to use Docker? : production ● docker-compose.yml ● 5 containers ○ database ○ redis ○ api ○ front ○ nginx ● This is for production ○ It builds from images db: image: postgres redis: image: redis api: restart: always image: ulabox/api:latest links: - redis - db front: restart: always image: ulabox/front:latest links: - redis - db nginx: restart: always image: ulabox/nginx:latest ports: - "80:80" links: - front - api Raül Pérez 20/01/2016
  • 11. How to use Docker? : development ● docker-compose-dev.yml ● 5 containers ○ database ○ redis ○ api ○ front ○ nginx ● This is for development ○ It builds from source code api: build: ./repos/api volumes: - ./repos/api:/src front: build: ./repos/front volumes: - ./repos/front:/src nginx: build: ./repos/nginx volumes: - ./nginx/conf.d:/etc/nginx/conf.d Raül Pérez 20/01/2016
  • 12. How to use Docker? docker-compose -f docker-compose.yml -f dev.yml up -d ● Uses docker composition of services https://docs.docker.com/compose/extends/ ● First use docker-compose.yml ● Second ‘extend’ the service overriding fields with dev.yml ● Do not worry anymore about how to link prod & dev, you just got it. :) Raül Pérez 20/01/2016
  • 13. How to use Docker? Workflow ● Yes but, how do i work on a component of my service? ○ Do I need a shared folder? ○ Do I need to ssh to to the container? ○ How can i change/build/restart? ● Well there is no a perfect solution for this … yet. Raül Pérez 20/01/2016
  • 14. How to use Docker? docker-compose -f docker-compose.yml -f dev.yml run <service> <cmd> --service-ports ● Service ports allows you to read dependencies and start the related containers of the one you choose. ● It executes also CMD overriding the default command. ● You can use it like the normal docker CLI to start a container and expose a path as a volume. Raül Pérez 20/01/2016