Presentation is loading. Please wait.

Presentation is loading. Please wait.

Docker Martin Meyer 2014-10-31. Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms Hello World Terminology: Image and.

Similar presentations


Presentation on theme: "Docker Martin Meyer 2014-10-31. Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms Hello World Terminology: Image and."— Presentation transcript:

1 Docker Martin Meyer 2014-10-31

2 Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms Hello World Terminology: Image and Containers Volume Mounting, Port Publishing, Linking Dockerfile, Dockerhub Resource Usage 2

3 3 What is Docker? Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating system–level virtualization on Linux. [Source: en.wikipedia.org]

4 4 Docker: Name docker [naut.]: der Dockarbeiter, der Hafenarbeiter Source: leo.org Provide a uniformed wrapper around a software package: «Build, Ship and Run Any App, Anywhere» [www.docker.com] –Similar to shipping containers: The container is always the same, regardless of the contents and thus fits to all trucks, cranes, ships,... [www.docker.com]

5 5 Docker vs. Virtual Machine Source: https://www.docker.com/whatisdocker/

6 6 Docker Technology libvirt: Platform Virtualization LXC (LinuX Containers): Multiple isolated Linux systems (containers) on a single host Layered File System [Source: https://docs.docker.com/terms/layer/]

7 7 Docker History 2013-03: Releases as Open Source 2013-09: Red Hat collaboration (Fedora, RHEL, OpenShift) 2014-03: 34th most starred GitHub project 2014-05: JAX Innovation Award (most innovative open technology)

8 8 Technology Radar 2014-01: Assess 2014-07: Trial Source: http://www.thoughtworks.com/radar /tools/docker

9 9 Run Platforms Various Linux distributions (Ubuntu, Fedora, RHEL, Centos, openSUSE,...) Cloud (Amazon EC2, Google Compute Engine, Rackspace) 2014-10: Microsoft announces plans to integrate Docker with next release of Windows Server

10 10 Hello World Simple Command - Ad-Hoc Container Windows: VirtualBox VM (boot2docker) –Use boot2docker link to connect to VM in command prompt (better graphics) docker run ubuntu /bin/echo ‘Hello World’ – docker images [-a] – docker ps –a

11 11 Terminology - Image Persisted snapshot that can be run –images: List all local images –run: Create a container from an image and execute a command in it –tag: Tag an image –pull: Download image from repository –rmi: Delete a local image This will also remove intermediate images if no longer used

12 12 Terminology - Container Runnable instance of an image –ps: List all running containers –ps –a: List all containers (incl. stopped) –top: Display processes of a container –start: Start a stopped container –stop: Stop a running container –pause: Pause all processes within a container –rm: Delete a container –commit: Create an image from a container

13 13 Daemon Container Open Terminal in container: – docker run –it ubuntu /bin/bash Make any modification We can create a new image with the modifications: –Docker commit [containerId] [image] Image: e.g. mytest/test1:1.0 Run as deamon: docker run –d [image] command – docker logs [-f] [containerId]

14 14 Mount Volumes Log to host file Adapt script to log to /log/hello3.log docker run -d –v /home/docker/log:/log /bin/bash /sayHello.sh Run second container: Volume can be shared

15 15 Publish Port Sample Web-Server: training/webapp –https://registry.hub.docker.com/u/traini ng/webapp/https://registry.hub.docker.com/u/traini ng/webapp/ docker run –d –P trianing/webapp –Random host port docker run –d –p 20000:5000 trianing/webapp –Map container port 5000 to host port 20000

16 16 Link Containers Data Volumes can be shared between containers Network information of dependent container can be injected: – docker run --name my_serv1 –d –e PROVIDER=Serv1 training/webapp – docker run –ti --link my_serv1:serv1 ubuntu /bin/bash set wget -qO- $SERV1_PORT_5000_TCP_ADDR:$SERV1_PORT_5000_ TCP_PORT

17 17 Dockerfile Create images automatically using a build script: «Dockerfile» Can be versioned in a version control system like Git or SVN, along with all dependencies Docker Hub can automatically build images based on dockerfiles on Github

18 18 Dockerfile Example Dockerfile: – FROM training/webapp ADD testFile.txt /testFile.txt ENV PROVIDER MyDockerFile Add testFile.txt docker build [DockerFileDir] docker inspect [imageId]

19 19 Docker Hub Public repository of Docker images –https://hub.docker.com/https://hub.docker.com/ –docker search [term] Automated: Has been automatically built from Dockerfile –Source for build is available on GitHub

20 20 Resource Usage top / ps / free -m Start 100 WebServer containers –docker run -d -p $hostPort:5000 -e "PROVIDER=$provider" training/webapp docker ps [containerId] top / ps / free -m

21 21 Documentation Docker homepage: https://www.docker.com/https://www.docker.com/ –Introduction: https://www.docker.com/whatisdocker/ https://www.docker.com/whatisdocker/ –Online tutorial: https://www.docker.com/tryit/https://www.docker.com/tryit/ –Installation and user guide: https://docs.docker.com/ https://docs.docker.com/ InfTec TecBoard: https://inftec.atlassian.net/wiki/display/TEC/D ocker https://inftec.atlassian.net/wiki/display/TEC/D ocker –Includes this presentation

22 22


Download ppt "Docker Martin Meyer 2014-10-31. Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms Hello World Terminology: Image and."

Similar presentations


Ads by Google