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

Dockers

 Dockers

Docker use cases

Luigi Maselli

April 03, 2016
Tweet

More Decks by Luigi Maselli

Other Decks in Technology

Transcript

  1. LIMITAZIONI E DIFFERENZE CON VMS Sandbox per processi in esecuzione

    Partenza istantanea Kernel, architettura, fs, .., dell' Host Stateless (o per lo meno lo stato è esplicito)
  2. BIG PICTURE "OPEN CLOUD" > SERVER Aggiornamenti istantanei, atomici Build

    ripetibili: stack + myapp + config + data = WIN! Astrazione "multi computer" indipendente dal cloud provider Autoscaling per gestire picchi sul cloud più economico Allocare app su nodo con caratteristiche specifiche (es EU+SSD+REPLICA2)
  3. docker pull ubuntu:15.04 15.04: Pulling from library/ubuntu 9502adfba7f1: Pull complete

    4332ffb06e4b: Pull complete 2f937cc07b5f: Pull complete a3ed95caeb02: Pull complete Digest: sha256:2fb27e433b3ec.. Status: Downloaded newer image for ubuntu:15.04 docker run -ti --rm ubuntu:15.04 root@009b5007de75:/# echo "ciao ne!" > /tmp/prova.txt root@009b5007de75:/# exit # (altro terminale) docker diff 009b5007de75 C /tmp A /tmp/prova.txt docker diff 009b5007de75 Error response from daemon: No such container: 009b5007de7
  4. NON SOLO UBUNTU (DEBIAN, REDHAT,..) docker images ubuntu 15.04 ...

    131.3 MB debian 8 ... 125.1 MB busybox latest ... 2.43 MB gliderlabs/alpine 3.1 ... 5.026 MB
  5. DOCKERFILE, LA PROPRIA RICETTA FROM alpine:3.2 MAINTAINER Luigi Maselli grigio.org

    RUN apk add --update pm-utils nodejs && \ rm -rf /var/cache/apk/* ADD ./app.js / EXPOSE 8080 CMD ["node", "app.js"] docker build -t grigio/web-pm-suspend .
  6. E SE CI FOSSE IL DB? DOCKER-COMPOSE web: build: .

    environment: - HOSTNAME=demo.corso-javascript.it # exampleapp_db_1 generated by docker-compose - MONGOURL=mongodb://exampleapp_db_1:27017/example_app links: - db db: image: mongo volumes: - db:/data/db docker-compose up - d
  7. Demo docker ps docker rm -f dockerui && docker run

    -d --name=dockerui --privileged -p 9000:9000 -v / # dentro progetto docker-compose up -d