Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker 101 - Mario Loriedo

SingaSUG
September 09, 2015

Docker 101 - Mario Loriedo

SingaSUG

September 09, 2015
Tweet

More Decks by SingaSUG

Other Decks in Technology

Transcript

  1. Hi I'm Mario Italian based in Paris Software Engineer @

    Zenika (ex IBMer) Docker official trainer and contributor I've developped sublime docker and doclipser mariolet l0rd
  2. Some well known problems Steve, the (un)believer developer: "It works

    on my machine!" Bill, an (im)patient developer: "It took me one week to setup the development environment"
  3. Why Docker? Lightweight containers is a 15yrs old technology. With

    Docker it has become: • Easy to use • Widely adopted • Defined a standard
  4. Easy to run a container What happened here? • Generated

    an Linux container • Allocated a new file system • Mounted a read/write layer • Allocated a network interface • Set an IP for it • Run a process inside the container • Captured the output and returned to the client
  5. Easy to create a custom image Dockerfile FROM ubuntu RUN

    apt-get install -y curl CMD curl ipinfo.io/ip $ docker build -t mycustomimage . $ docker run mycustomimage
  6. Volumes to persist data This cattle vs pets thing docker

    run -ti ubuntu docker run -ti ubuntu Volumes and the state of an application docker run -ti -v ~/data/:/data/ ubuntu
  7. Links to let containers talk securely # Run tomcat in

    a container docker run -d --name myserver tomcat # Access to tomcat from another container docker run --link myserver \ fedora \ curl myserver:8080
  8. Multi-containers configurations db: image: postgres web: build: . command: python

    manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" links: - db Docker Compose YML file