Simplify your dev life with Docker (WebElement Banská Bystrica)

Simplify your dev life with Docker (WebElement Banská Bystrica)

1633975316e340c5f24414567a3f3679?s=128

Vladimír Kriška

August 20, 2015
Tweet

Transcript

  1. Simplify your dev life with Docker Vladimír Kriška (@ujovlado) WebElement

    Banská Bystrica
  2. Past (vedle pasti) • New computer • Install Apache|Nginx, MySQL|PostgreSQL,

    PHP, MongoDB, etc., etc. • Start services … start coding After few weeks • OMG this project needs newer version of MySQL • Problems • And problems
  3. Future • New computer • Prepare Dockerfile with exact requirements

    • Build it • Run it (with services inside) … start coding After few weeks • OMG this project needs … whatever • Never mind, I'll build a new container • Profit
  4. Yo Dawg, I heard you like computers So I put

    computer into computer, So you can computer while you computer
  5. What is Docker? "Docker is an open platform for building,

    shipping and running distributed applications."
  6. What is Docker for me? Primary • Engine for working

    with containers • Any virtual machine • Testing platform • Tool to not install "shit" to your computer Not yet • Running in production
  7. What really Docker is? Same as your system • Set

    of files with "/sbin/init" file So, you can • Take parts of your system and virtualize them without need to virtualize full OS
  8. Containers without Docker (!) https://chimeracoder.github.io/docker-without-docker mkdir debian-tree debootstrap --arch=amd64 unstable

    debian-tree systemd-nspawn -D debian-tree/ /bin/bash machinectl list machinectl poweroff debian-tree
  9. OK, let's go Three basic steps 1) Create Dockerfile 2)

    Build it 3) Run it
  10. Dockerfile & Build & Run FROM debian:jessie RUN apt-get update

    && apt-get upgrade -y RUN apt-get install nginx -y RUN mkdir -p /data COPY package.tar.gz /data/ EXPOSE 80 docker build -t wblmnt/bb . docker run -i -t --rm -p 8037:80 wblmnt/bb:latest
  11. Case I & Case II Everything in one container •

    Easy to start • Same as any virtual machine / container • Need to commit changes at the end (as many times as containers count)
  12. Case III Multiple containers with separate store • For production

    environment • Hard to setup • Deployment?
  13. Examples

  14. Thanks