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

Introduction to Docker

Introduction to Docker

Talk given in the Ruby User Group Berlin on June 5th, 2014

José Tomás Albornoz

June 05, 2014
Tweet

More Decks by José Tomás Albornoz

Other Decks in Programming

Transcript

  1. Introduction to Docker
    by josé albornoz

    View Slide

  2. José Albornoz
    chilean
    ruby = <3
    co-founding startup
    !
    @eljojo
    eljojo.net

    View Slide

  3. what’s docker?

    View Slide

  4. what’s docker?
    • Management system for LXC Containers
    • Lightweight virtual machines
    • Applications are isolated and easy to distribute

    View Slide

  5. Demo

    View Slide

  6. how does it work?

    View Slide

  7. Docker Image
    • Snapshot of filesystem
    • They run one process

    View Slide

  8. Demo

    View Slide

  9. Layers

    View Slide

  10. Layers
    Ubuntu

    View Slide

  11. Layers
    Ubuntu
    nginx

    View Slide

  12. Layers
    Ubuntu
    nginx
    ruby

    View Slide

  13. Layers
    Ubuntu
    nginx
    ruby
    rails application

    View Slide

  14. Layers
    !"5e66087f3ffe Virtual Size: 192.5 MB
    # $"4d26dd3ebc1c Virtual Size: 192.7 MB
    # $"99ec81b80c55 Virtual Size: 266 MB
    # $"efc4fbcd007f Virtual Size: 584.5 MB
    # $"1f089cc15e82 Virtual Size: 584.5 MB Tags: ubuntu
    # #$"5c1088024f94 Virtual Size: 876.2 MB Tags: ubuntu-desktop
    # # $"afe3aba3e6e0 Virtual Size: 1.06 GB Tags: chrome
    # !"a97296852f54 Virtual Size: 606.2 MB
    # # $"4e81a0cd7256 Virtual Size: 606.2 MB Tags: ruby
    # !"c2b10e69958d Virtual Size: 596.8 MB
    # # $"0a422c0cdf16 Virtual Size: 596.8 MB Tags: redis
    # $"9f3000270ba2 Virtual Size: 643.8 MB
    # $"4b49b0b7aa4c Virtual Size: 643.8 MB
    # $"1535da87b710 Virtual Size: 660.8 MB Tags: nodejs

    View Slide

  15. Dockerfile
    • Images are created through Dockerfiles
    • Simple script that prepares the system to run the
    app

    View Slide

  16. Dockerfile
    FROM eljojo/golang-docker


    WORKDIR /app


    RUN git clone https://github.com/eljojo/shouldidothat.git .

    RUN go get -d

    RUN go build -o shouldidothat


    CMD ["/app/shouldidothat", "-c", "/etc/
    shouldidothat/conf.json"]

    View Slide

  17. Container
    • Instance of Docker Image
    • Has it’s own private IP
    • You can map folders in host to folders in container

    View Slide

  18. Demo

    View Slide

  19. Registries
    • Like Git but for Docker Images
    • The Docker Index will host your public images for
    free

    View Slide

  20. CoreOS

    View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. Thanks!

    View Slide

  26. github.com/eljojo/altoids

    View Slide