$30 off During Our Annual Pro Sale. View Details »

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

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

Vladimír Kriška

August 20, 2015
Tweet

More Decks by Vladimír Kriška

Other Decks in Programming

Transcript

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

    View Slide

  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

    View Slide

  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

    View Slide

  4. Yo Dawg, I heard you like computers
    So I put computer into computer,
    So you can computer while you computer

    View Slide

  5. What is Docker?
    "Docker is an open platform for building,
    shipping and running distributed applications."

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  9. OK, let's go
    Three basic steps
    1) Create Dockerfile
    2) Build it
    3) Run it

    View Slide

  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

    View Slide

  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)

    View Slide

  12. Case III
    Multiple containers with separate store

    For production environment

    Hard to setup

    Deployment?

    View Slide

  13. Examples

    View Slide

  14. Thanks

    View Slide