Docker Basics
-
Upload
duckduckgo -
Category
Technology
-
view
147 -
download
0
Transcript of Docker Basics
![Page 1: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/1.jpg)
Docker Fundamentals
Mr. Mohan Pawar
![Page 2: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/2.jpg)
What is Docker ? Containers Vs Virtual Machines Docker terminology
◦ Docker engine◦ Images◦ Containers◦ Registry◦ Docker Hub◦ Docker CloudIntroduction to ImagesGetting started with Containers
Agenda
![Page 3: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/3.jpg)
It’s all about data…
![Page 4: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/4.jpg)
There’s rock, paper, scissors and then there’s information.
![Page 5: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/5.jpg)
![Page 6: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/6.jpg)
![Page 7: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/7.jpg)
Docker is an open source engine that automates the deployment of any application as a lightweight, portable and self-sufficient that will run virtually anywhere.
Package your application into a standardized unit of software development.
What is Docker ?
![Page 8: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/8.jpg)
Provide a uniformed wrapper around a software package: «Build, Ship and Run Any App, Anywhere»◦Similar to shipping containers: The
container is always the same, regardless of the contents and thus fits on all trucks, cranes, ships, ...
Docker : name
![Page 9: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/9.jpg)
Docker vs. Virtual Machine
![Page 10: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/10.jpg)
libvirt: Platform Virtualization LXC (LinuX Containers): Multiple isolated
Linux systems (containers) on a single host Layered File System
Docker Technology
![Page 11: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/11.jpg)
2013-03: Releases as Open Source 2013-09: Red Hat collaboration (Fedora,
RHEL, OpenShift) 2014-03: 4th most starred GitHub project 2014-05: JAX Innovation Award (most
innovative open technology)
Docker History
![Page 12: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/12.jpg)
12
Run Platforms Various Linux distributions
(Ubuntu, Fedora, RHEL, Centos, openSUSE, ...)
Cloud (Amazon EC2, Google Compute Engine, Rackspacem, Azure)
2016-12: Microsoft announces plans to integrate Docker with next release of Windows Server
![Page 13: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/13.jpg)
Docker is the world’s leading software
containerization platform.
![Page 14: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/14.jpg)
Hello WorldSimple Command - Ad-Hoc Container docker run ubuntu echo Hello World
◦ docker images [-a]◦ docker ps –a
![Page 15: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/15.jpg)
If you change a single line in your project, how much time is required to
deploy it in production ?
![Page 16: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/16.jpg)
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
Terminology - Image
![Page 17: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/17.jpg)
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
Terminology - Container
![Page 18: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/18.jpg)
18
Containercid4
Containercid3
Image vs. ContainerBase Imageubuntu:latest
Containercid1
run
Containercid1
cmd new state
New Imageiid1
commit
base image
Containercid2
run
![Page 19: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/19.jpg)
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
Dockerfile
![Page 20: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/20.jpg)
Dockerfile:◦ FROM ubuntuENV DOCK_MESSAGE Hello My WorldADD dir /filesCMD ["bash", "someScript"]
docker build [DockerFileDir] docker inspect [imageId]
Dockerfile Example
![Page 21: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/21.jpg)
docker run –ti –v /hostLog:/log ubuntu
Run second container: Volume can be shared◦ docker run –ti --volumes-from firstContainerName ubuntu
Mount Volumes
![Page 22: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/22.jpg)
docker run –t –p 8080:80 ubuntu nc –l 80◦ Map container port 80 to host port 8080◦ Check on host: nc localhost 8080
Link with other docker container◦ docker run -ti --link containerName:alias ubuntu
◦ See link info with set
Publish Port
![Page 23: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/23.jpg)
Docker Images: Docker Hub Vagrant: «Docker for VMs» Automated Setup
◦ Puppet, Chef, Ansible, ... Docker Ecosystem
◦ skydock / skydns◦ fig
Around Docker
![Page 24: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/24.jpg)
Public repository of Docker images◦ https://hub.docker.com/◦ docker search [term]
Automated: Has been automatically built from Dockerfile◦ Source for build is available on GitHub
Docker Hub
![Page 25: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/25.jpg)
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
Resource Usage
![Page 26: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/26.jpg)
Development Environment Environments for Integration Tests Quick evaluation of software Microservices Multi-Tenancy Unified execution environment (dev test
prod (local, VM, cloud, ...) e.g. BookMyShow transfer their 3 servers
to docker.
Docker Use Cases
![Page 27: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/27.jpg)
![Page 28: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/28.jpg)
All IT companies are migrating their servers with docker.
Micro-service architecture Serverless computing.
Future Scope
![Page 29: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/29.jpg)
Docker homepage: https://www.docker.com/◦ Introduction:
https://www.docker.com/whatisdocker/ ◦ Online tutorial: https://www.docker.com/tryit/◦ Installation and user guide:
https://docs.docker.com/ InfTec TecBoard:
https://inftec.atlassian.net/wiki/display/TEC/Docker
Documentation
![Page 30: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/30.jpg)
https://bitbucket.org/inftec/vagrant-playground/branch/docker-demo
Multi-Container-Setup◦ Logging-Container◦ Echo-Container◦ Client-Container
Hands On
![Page 31: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/31.jpg)
https://dockerinfo.wordpress.com/ http://mohan08p.strikingly.com/ https://www.quora.com/profile/Mohan-Pawar
-1 https://github.com/mohan08p https://in.linkedin.com/in/mohan-pawar-91a
5432a
Contact me
![Page 32: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/32.jpg)
Containerization is the fastest, most resource effective, and most secure setup we know to date and docker is drifting the IT world in more agile way to achieved easy to create architecture.
Conclusion
![Page 33: Docker Basics](https://reader036.fdocuments.us/reader036/viewer/2022070516/587430be1a28ab72188b7853/html5/thumbnails/33.jpg)
Thank you.