Slide 1

Slide 1 text

Leading in IT Education .co.il www. Introduction

Slide 2

Slide 2 text

Leading in IT Education .co.il www. static website user data web frontend queue analytics development environments qa servers customer data center public cloud production cluster Challenge ?

Slide 3

Slide 3 text

Leading in IT Education .co.il www. cargo of cars cargo of stuff deployment manual labor Hand-loading a ship cost $5.86 per ton before 1956.

Slide 4

Slide 4 text

Leading in IT Education .co.il www. After 1956, using containers, it cost ¢16 per ton to load a ship. Containerization greatly reduced the time to load and unload cargo. Malcom Purcell McLean "A ship earns money only when she is at sea".

Slide 5

Slide 5 text

Leading in IT Education .co.il www. static website user data web frontend queue analytics development environments qa servers customer data center public cloud production cluster

Slide 6

Slide 6 text

Leading in IT Education .co.il www. so, why containers? STANDARDIZATION … facilitate commoditization of formerly custom processes and help maximize compatibility, interoperability, safety, repeatability, and quality. - wikipedia

Slide 7

Slide 7 text

Leading in IT Education .co.il www. Virtualization

Slide 8

Slide 8 text

Leading in IT Education .co.il www. virtual machines docker

Slide 9

Slide 9 text

Leading in IT Education .co.il www. _docker_

Slide 10

Slide 10 text

Leading in IT Education .co.il www.

Slide 11

Slide 11 text

Leading in IT Education .co.il www. > docker run busybox /bin/echo ‘Hello World!’ Hello World! hello world! image command to run output

Slide 12

Slide 12 text

Leading in IT Education .co.il www. docker CONTAINERS

Slide 13

Slide 13 text

Leading in IT Education .co.il www. > docker run --tty --interactive busybox /bin/sh / # exit interactive container keep stdin attached image command to run

Slide 14

Slide 14 text

Leading in IT Education .co.il www. $ uname -a # show kernel/linux version $ pwd # show current directory $ ls # show files in directory $ whoami # what is my user name $ id # what is my user id $ ps # what processes are running $ hostname # what is the server hostname $ ifconfig # network interface list $ netstat # network activity $ netstat -r # routing table $ mount # mounted file systems inspecting a linux environment

Slide 15

Slide 15 text

Leading in IT Education .co.il www. > docker run -t -i -e PS1='\u@\h:\w# ' busybox /bin/sh root@abcdef:/# exit > container environment environment variable

Slide 16

Slide 16 text

Leading in IT Education .co.il www. > docker run -ti busybox \ /bin/sh -c 'while true; do date; sleep 1; done' Sun Mar 23 18:57:17 IST 2015 Sun Mar 23 18:57:18 IST 2015 Sun Mar 23 18:57:19 IST 2015 Sun Mar 23 18:57:20 IST 2015 Sun Mar 23 18:57:21 IST 2015 ^C docker clock

Slide 17

Slide 17 text

Leading in IT Education .co.il www. > docker run -d busybox \ /bin/sh -c 'while true; do date; sleep 1; done' e04e6a90bd09723fcda724ecd9392434992d7d0fd335bb465cd5f618570ee68e daemon clock! Hey! Where is the REAL output?

Slide 18

Slide 18 text

Leading in IT Education .co.il www. > docker ps > docker top container_name_or_id > docker logs container_name_or_id > docker stop container_name_or_id > docker start container_name_or_id > docker rm container_name_or_id running containers CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d40ad71102b8 busybox:latest /bin/sh -c 'while tr 2 minutes ago Up 2 minutes berserk_hopper

Slide 19

Slide 19 text

Leading in IT Education .co.il www. > docker inspect container_name # filtering a single property (using GO text/template) > docker inspect -f '{{ .NetworkSettings.IPAddress }}' cont_name container metadata

Slide 20

Slide 20 text

Leading in IT Education .co.il www. > docker run -d busybox \ nc -ll -p 80 -e /bin/echo -e "HTTP/1.1 200 OK\n\nHello World.\n" 00ac7444f87e797d1a5e6cdd2eb8f916e7fefddcaa9d751551719fe49e5c9732 > docker inspect `docker ps -ql` | grep IPAddress "IPAddress": "172.17.0.2", > curl http:// Hello World. a hello-world web server

Slide 21

Slide 21 text

Leading in IT Education .co.il www. containers : what we learned so far ✓ running commands in a container ✓ starting interactive containers ✓ namespace separation ✓ containers with daemons ✓ inspecting live containers ✓ container metadata ✓ docker bridge networking

Slide 22

Slide 22 text

Leading in IT Education .co.il www.

Slide 23

Slide 23 text

Leading in IT Education .co.il www.

Slide 24

Slide 24 text

Leading in IT Education .co.il www. en.wikipedia.org/wiki/SS_Ideal_X on April 26, 1956 the Ideal X carried 58 containers from Port Newark, New Jersey, to Port of Houston, Texas, where 58 trucks were waiting to be loaded with the containers.

Slide 25

Slide 25 text

Leading in IT Education .co.il www. www.worldslargestship.com

Slide 26

Slide 26 text

Leading in IT Education .co.il www. docker IMAGES

Slide 27

Slide 27 text

Leading in IT Education .co.il www. > docker run -ti busybox /bin/sh / # cat > bin/server.sh #!/bin/sh PATH=/bin:/usr/bin nc -ll -p 80 -e echo -e "HTTP/1.1 200 OK\n\nI am very FAST!" ^D / # chmod +x bin/server.sh / # exit modifying containers

Slide 28

Slide 28 text

Leading in IT Education .co.il www. > docker ps --latest > docker diff container_name A /.ash_history C /bin A /bin/server.sh what changed?

Slide 29

Slide 29 text

Leading in IT Education .co.il www. container commit > docker commit -a ‘Evgeny Zislis ’ \ abcde123 haws/webserver 96e632d705113241816462ba9c7e94451384a505613dff64af192daf7bc78efb Hey! What is this?

Slide 30

Slide 30 text

Leading in IT Education .co.il www. > docker images > docker search mongodb > docker pull mongodb/mongodb:latest > docker run -d mongodb/mongodb using images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE busybox latest a9eb17255234 5 days ago 2.433 MB ubuntu 14.04 99ec81b80c55 4 weeks ago 266 MB

Slide 31

Slide 31 text

Leading in IT Education .co.il www. docker HUB hub.docker.com

Slide 32

Slide 32 text

Leading in IT Education .co.il www. # server.sh #!/bin/sh PATH=/bin:/usr/bin nc -ll -p 80 -e echo -e "HTTP/1.1 200 OK\n\nI am very FAST!" # Dockerfile FROM busybox:latest ADD server.sh bin/server.sh ENTRYPOINT bin/server.sh > chmod 0750 server.sh && docker build -t haws/webserver . build an image

Slide 33

Slide 33 text

Leading in IT Education .co.il www. tags for images > docker tag webserverNEW webserver > docker login user: haws pass: verysecret mail: [email protected] > docker push haws/webserverNEW

Slide 34

Slide 34 text

Leading in IT Education .co.il www. Dockerfile instructions http://docs.docker.com/reference/builder/ FROM image:tag MAINTAINER Haws DevOpsIL RUN command # runs it in /bin/sh -c ‘command’ RUN [ “exec”, “param”, “param” ] CMD command # or CMD [ “exec”, “param”, “param” ] ENTRYPOINT command # or ENTRYPOINT [ “exec”, “param” ]

Slide 35

Slide 35 text

Leading in IT Education .co.il www. ENV key value ADD src dst # src is file, archive, or url (http://) COPY src dst USER someone WORKDIR somewhere Dockerfile instructions

Slide 36

Slide 36 text

Leading in IT Education .co.il www. ✓ commit changed containers ✓ inspect difference made to container ✓ searching for community images ✓ docker image pulling and pushing ✓ building images using Dockerfiles ✓ injecting files into images with ADD images : what we learned so far

Slide 37

Slide 37 text

Leading in IT Education .co.il www.

Slide 38

Slide 38 text

Leading in IT Education .co.il www. Port of Shanghai how many TEUs it handled in 2014? how many ships handled?

Slide 39

Slide 39 text

Leading in IT Education .co.il www. Port of Shanghai 35.29 million TEU in 2014 busiest container port for the fifth consecutive year. handling more than 50,000 ships annually

Slide 40

Slide 40 text

Leading in IT Education .co.il www. blog.flux7.com/blogs/docker/8-ways-to-use-docker-in-the-real-world

Slide 41

Slide 41 text

Leading in IT Education .co.il www. docs. docker. com

Slide 42

Slide 42 text

Leading in IT Education .co.il www. docker.com/community

Slide 43

Slide 43 text

Leading in IT Education .co.il www. blog. docker.com /docker- weekly- archives

Slide 44

Slide 44 text

Leading in IT Education .co.il www. Thank you! www.devops.co.il We invite you to join Operations Israel Facebook group on on.fb.me/Ops-IL we are hiring at [email protected]