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

What's new in Docker ?

What's new in Docker ?

It’s the first breakout after the keynote and you need to know more about all the latest and greatest Docker announcements. We've got you covered! In this session, Victor Vieux will go deeper, looking into what's new with Docker, demoing the latest features and answering your questions.

Victor Vieux

April 18, 2017
Tweet

More Decks by Victor Vieux

Other Decks in Technology

Transcript

  1. What’s new in Docker Victor Vieux Software Engineer, 
 Docker

    @vieux
  2. 1. Versioning 2. Builder 3. Runtime 4. Swarm mode 5.

    Compose Agenda
  3. … -> 1.11 -> 1.12 -> 1.13 -> 17.03-ce ->

    17.04-ce -> 17.05-ce -> … YY.MM “ce” stands for Community Edition as opposed to “ee” for Enterprise Edition New versioning…
  4. …and new release schedule Docker CE Docker EE Monthly Quarterly

    Supported for 4 months Quarterly Supported for 12 months
  5. All features presented here are available in 17.05-rc1 Available today!

    17.XX …and new release schedule
  6. Builder

  7. Multi-Stage builds step 1 step 2 step 3 step 4

    step 1 step 2 step 3 step 4 step 5 step 6 step 7 docker build & Dockerfile improvement 17.05
  8. FROM ubuntu RUN apt-get install make g++ ADD . /src

    RUN cd /src && make EXPOSE 80 ENTRYPOINT /usr/local/bin/app Multi-Stage builds docker build & Dockerfile improvement 17.05
  9. FROM alpine RUN apk add make g++ ADD . /src

    RUN cd /src && make EXPOSE 80 ENTRYPOINT /usr/local/bin/app Multi-Stage builds docker build & Dockerfile improvement 17.05
  10. FROM alpine RUN apk add make g++ ADD . /src

    RUN cd /src && make Multi-Stage builds docker build & Dockerfile improvement FROM busybox ADD ./app /usr/local/bin EXPOSE 80 ENTRYPOINT /usr/local/bin/app Makefile and/or shell script 17.05
  11. FROM alpine AS build-env RUN apk add make g++ ADD

    . /src RUN cd /src && make FROM busybox COPY --from=build-env /src/build/app /usr/local/bin/app EXPOSE 80 ENTRYPOINT /usr/local/bin/app Multi-Stage builds docker build & Dockerfile improvement 17.05
  12. Multi-Stage builds docker build & Dockerfile improvement Let’s see a

    more complicated example: Current Dockerfile: https://github.com/docker/dockercraft Proposed Changes: https://github.com/docker/dockercraft/pull/83 17.05
  13. Multi-Stage builds wget docker wget cuberite go build dockercraft run

    dockercraft docker build & Dockerfile improvement install wget 17.05
  14. Multi-Stage builds wget docker wget cuberite go build dockercraft run

    dockercraft install wget wget docker docker build & Dockerfile improvement wget cuberite run dockercraft go build dockercraft install wget 17.05
  15. Multi-Stage builds docker build & Dockerfile improvement 838MB 155MB final

    image size: final image size: * * 80% comes from debian:jessie, required by cuberite 17.05
  16. • docker build . • docker build --target=cuberite . •

    docker build --target=docker . Specify target on build docker build & Dockerfile improvement 17.05
  17. • docker build . • docker build --build-arg GO_VERSION=latest .

    • docker build --build-arg GO_VERSION=1.7 . ARG in FROM docker build & Dockerfile improvement ARG GO_VERSION=1.8 FROM golang:${GO_VERSION} ADD . /src WORKDIR /src RUN go build CMD [“/bin/app”] 17.05
  18. Runtime

  19. docker system subcommands added • docker system df • docker

    system prune • docker container/image/network/volume prune Data management commands $ docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 5 1 2.777 GB 2.647 GB (95%) Containers 1 1 0 B 0B Local Volumes 4 1 3.207 GB 2.261 GB (70%) 17.03
  20. docker plugin subcommands added Plugins are now managed by the

    docker daemon and run as containers • docker plugin install <plugin> • docker plugin enable/disable <plugin> • docker plugin set <plugin> KEY=value New plugin system 17.03
  21. docker plugin subcommands added New plugin system EXAMPLE: https://github.com/vieux/docker-volume-sshfs 17.03

  22. Plug-ins: Building, Shipping, Storing and Running by Nandhini Santhanam &

    Tibor Vass Tomorrow at 1:30pm in Ballroom D Deep dive session
  23. Swarm mode

  24. Synchronous service commands swarm mode improvements $ docker service create

    --detach=false --name redis --replicas 5 redis overall: [====================> ] 2B/5B 1/5: starting [========================================> ] 8B/9B 2/5: starting [========================================> ] 8B/9B 3/5: starting [========================================> ] 8B/9B 4/5: running [=============================================>] 9B/9B 5/5: running [=============================================>] 9B/9B $ 17.05
  25. DEMO using http://play-with-docker.com Thanks to @marcosnils and @xetorthio Synchronous service

    commands swarm mode improvements 17.05
  26. “rollback” action added to --update-failure-action (in addition to “pause” and

    “continue”) with all the associated flags --rollback-delay --rollback-failure-action --rollback-max-failure-ratio --rollback-monitor --rollback-parallelism Service rollback on failure swarm mode improvements 17.04
  27. rack: SFO-2 rack: SFO-1 Topology-aware scheduling node1 node2 node3 swarm

    mode improvements 17.04
  28. rack: SFO-2 rack: SFO-1 Topology-aware scheduling node1 node2 node3 docker

    service create --replicas=6 postgres swarm mode improvements 17.04
  29. docker service create --replicas=6 postgres rack: SFO-2 rack: SFO-1 Topology-aware

    scheduling node1 node2 node3 swarm mode improvements 17.04
  30. docker service create --replicas=6 postgres docker service create --replicas=2 webapp

    rack: SFO-2 rack: SFO-1 Topology-aware scheduling node1 node2 node3 swarm mode improvements 17.04
  31. docker service create --replicas=6 postgres docker service create --replicas=2 webapp

    rack: SFO-2 rack: SFO-1 Topology-aware scheduling node1 node2 node3 swarm mode improvements 17.04
  32. rack: SFO-2 rack: SFO-1 Topology-aware scheduling node1 node2 node3 swarm

    mode improvements 17.04
  33. rack: SFO-2 rack: SFO-1 Topology-aware scheduling node1 node2 node3 docker

    service create --replicas=6 --placement-pref-add=rack postgres swarm mode improvements 17.04
  34. docker service create --replicas=6 --placement-pref-add=rack postgres rack: SFO-2 rack: SFO-1

    swarm mode improvements Topology-aware scheduling node1 node2 node3 17.04
  35. docker service create --replicas=6 --placement-pref-add=rack postgres docker service create --replicas=2

    --placement-pref-add=rack webapp rack: SFO-2 rack: SFO-1 swarm mode improvements Topology-aware scheduling node1 node2 node3 17.04
  36. rack: SFO-2 rack: SFO-1 swarm mode improvements Topology-aware scheduling node1

    node2 node3 docker service create --replicas=6 --placement-pref-add=rack postgres docker service create --replicas=2 --placement-pref-add=rack webapp 17.04
  37. Service logs swarm mode improvements $ docker service create --replicas

    2 --name redis redis $ docker service logs redis redis.2.najk8sq1klac@node2 | _.-``__ ''-._ redis.2.najk8sq1klac@node2 | _.-`` `. `_. ''-._ Redis 3.2.8 (00000000/0) 64 bit redis.1.lfkijq3fx3q8@node1 | _.-``__ ''-._ redis.2.najk8sq1klac@node2 | .-`` .-```. ```\/ _.,_ ''-._ redis.1.lfkijq3fx3q8@node1 | _.-`` `. `_. ''-._ Redis 3.2.8 (00000000/0) 64 bit redis.2.najk8sq1klac@node2 | ( ' , .-` | `, ) Running in standalone mode redis.1.lfkijq3fx3q8@node1 | .-`` .-```. ```\/ _.,_ ''-._ redis.2.najk8sq1klac@node2 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 redis.1.lfkijq3fx3q8@node1 | ( ' , .-` | `, ) Running in standalone mode redis.2.najk8sq1klac@node2 | | `-._ `._ / _.-' | PID: 1 redis.1.lfkijq3fx3q8@node1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 redis.2.najk8sq1klac@node2 | `-._ `-._ `-./ _.-' _.-' redis.1.lfkijq3fx3q8@node1 | | `-._ `._ / _.-' | PID: 1 ... 17.05
  38. Under the Hood with Docker Swarm Mode by Drew Erny

    & Nishant Totla Today at 2:00pm in Ballroom D Deep dive session
  39. Compose

  40. docker stack subcommands added It is now possible to deploy

    services using compose files directly from docker • docker stack deploy --compose-file docker-compose.yml <my_stack> • docker stack list • docker stack rm <my_stack> Compose to Swarm 17.03
  41. docker-compose.yml improvements Main differences form v2 are: • Removed the

    non-portable options • build • volume-from • … • Added Swarm specific options • replicas • mode • … Compose Format version 3 17.03
  42. DEMO docker-compose.yml improvements Compose Format version 3 https://github.com/docker/example-voting-app/blob/master/docker-stack.yml 17.03

  43. ports: - 3000 - 3000-3005 - 49100:22 - 9090-9091:8080-8081 -

    127.0.0.1:8001:8001 - 127.0.0.1:5005-5010:5005-5010 - 6060:7060/udp Long syntax for ports docker-compose.yml improvements 17.04
  44. ports: - target: 6060 published: 7060 protocol: udp Long syntax

    for ports docker-compose.yml improvements 17.04 Also added specific swarm mode options
  45. volumes: - /var/lib/mysql - /opt/data:/var/lib/mysql - ./cache:/tmp/cache - datavolume:/var/lib/mysql -

    ~/configs:/etc/configs/:ro Long syntax for volumes docker-compose.yml improvements 17.04
  46. volumes: - type: bind source: ~/configs target: /etc/configs read_only: true

    Long syntax for volumes docker-compose.yml improvements 17.04 Also added specific swarm mode options
  47. Thanks, Don’t forget to vote! @vieux #dockercon Questions?