SlideShare a Scribd company logo
Prepared By Mutlu Okuducu
2020
https://github.com/mutluokuducu/Docker
• Docker is a container management service. The
keywords of Docker are develop,
ship and run anywhere. The whole idea of Docker is for
developers to easily develop applications, ship them
into containers which can then be deployed anywhere.
• Docker is an Open platform for developers and
sysadmins to build, ship and run distributed
applications.
• It can run on most Linux distributions, Windows and
Mac OS running Docker Engine (Toolbox).
WHAT IS DOCKER?
2020Prepared By Mutlu Okuducu
2020Prepared By Mutlu Okuducu
DOCKER FEATURES….
 Light-Weight
 Minimal overhead (cpu/io/network)
 Based on Linux containers
 Decrease storage consumption
 Uses layered filesystem to save space (AUFS/LVM)
 Portable
 Run it Everywhere! - Linux, Mac OS or Windows operating system that has Docker installed.
 Raspberry pi support.
 Move from one environment to another by using the same Docker technology.
 Self-sufficient
 A Docker container contains everything it needs to run
 Minimal Base OS
 Libraries and frameworks
 Application code
 A Docker container should be able to run anywhere that Docker can run.
2020Prepared By Mutlu Okuducu
IMAGES - CONTAINERS
 Docker images are executable packages that
include everything needed to run an application —
the code, a runtime, libraries, environment
variables, and configuration files.
 Docker containers are a runtime instance of an
image — what the image becomes in memory
when executed (that is, an image with state, or a
user process).
2020Prepared By Mutlu Okuducu
2020Prepared By Mutlu Okuducu
MOST USED COMMANDS
 docker version
2020Prepared By Mutlu Okuducu
A-DOCKER HUB
 Docker Hub is a service provided by Docker for finding and sharing container
images with your team.
 https://hub.docker.com/
2020Prepared By Mutlu Okuducu
Docker Pull
docker pull nginx
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest f949e7d76d63 2 weeks ago 126MB
 docker run --name nginx -d -p 8080:80 nginx
 Mutlus-MacBook-Pro:~ mokuducu$ docker ps –a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
85a54b8a660c nginx "nginx -g 'daemon of…" About an hour ago Up 37 minutes 0.0.0.0:8080->80/tcp nginx
 docker pull < image name>
2020Prepared By Mutlu Okuducu
IMAGES COMMANDS
Commands
 Docker images image list
 Docker images -q
q − It tells the Docker command to return
the Image ID’s only.
 Docker run <images > Imaged run details
 Docker rmi -f <image id> Force image delete
 Docker history <ImageID> History of image
 Docker inspect <imageid> Details of images
2020Prepared By Mutlu Okuducu
CONTAINER COMMANDS
Commands
 Docker inspect <imageid containerid> Details of container
 Docker stop Docker stop
 Docker logs <containerid> Image logs
 Docker exec <exqute command container> Docker exequte
 Docker history <ImageID > History of image
 docker top <ContainerID > Top container
 docker stats <ContainerID > Status of container
 Docker rm -f <container id> Force image delete
 docker network ls List of network
 docker network inspect <networkname > Details of network
 docker stop $(docker ps -a -q) Stop all container
 docker rm $(docker ps -a -q) Remove all container
2020Prepared By Mutlu Okuducu
B- DOCKER FILE
Dockerfile – Text file (recipe) used to create Docker images
Docker file name must be Dockerfile
2020Prepared By Mutlu Okuducu
Docker File Commands
ADD copies the files from a source on the host into the container’s own filesystem at
the set destination.
CMD can be used for executing a specific command within the container.
ENTRYPOINT sets a default application to be used every time a container is created
with the image.
ENV sets environment variables.
EXPOSE associates a specific port to enable networking between the container and
the outside world.
FROM defines the base image used to start the build process.
MAINTAINER defines a full name and email address of the image creator.
RUN is the central executing directive for Dockerfiles.
USER sets the UID (or username) which is to run the container.
VOLUME is used to enable access from the container to a directory on the host
machine.
WORKDIR sets the path where the command, defined with CMD, is to be executed.
LABEL allows you to add a label to your docker image.
2020Prepared By Mutlu Okuducu
Build Docker File
# Ubuntu
FROM ubuntu
MAINTAINER demousr@gmail.com
RUN apt-get update
RUN apt-get install –y nginx
CMD [“echo”,”Image created”]
 •The first line "#This is a sample Image" is a comment.
 •The next line has to start with the FROM keyword. It tells docker, from which base image
you want to base your image from. In our example, we are creating an image from
the ubuntu image.
 •The next command is the person who is going to maintain this image. Here you specify
the MAINTAINER keyword and just mention the email ID.
 •The RUN command is used to run instructions against the image. In our case, we first update
our Ubuntu system and then install the nginx server on our ubuntu image.
 •The last command is used to display a message to the user.
 docker build .
2020Prepared By Mutlu Okuducu
C- DOCKER-COMPOSE
Docker Compose is used to run multiple containers as a single service. For
example, suppose you had an application which required NGNIX and Redis, you
could create one file
Create Docker-Compose File at any location on your system
 All Docker Compose files are YAML
 File name docker-compose.yml
Install Docker Compose:
•From
github (https://github.com/docker/compose/releases)
•Using PIP
Pip install-U docker-compose
2020Prepared By Mutlu Okuducu
•Check docker-compose
docker-compose version (-v)
Check the validity of file by command
 Docker-compose config
Run docker-compose.yml file by command
 Docker-compose up –d (d Detached mode: Run containers in the background, print new container
names. Incompatible with --abort-on-container-exit.)
Down Docker compose
 Docker-compose down
2020Prepared By Mutlu Okuducu
Microservices
2020Prepared By Mutlu Okuducu
Scale
scale Set number of containers for a service
docker-compose up -d --scale <service name>=number of instance
 docker-compose up -d --scale database=4
2020Prepared By Mutlu Okuducu
COMPOSE COMMANDS
Commands
 docker-compose -help Help compose commands
 docker-compose version (-v) Compose version
 Docker-compose config Validate and view the Compose file
 Docker-compose up –d Create and start containers
 Docker-compose down Stop and remove containers, networks, images, and
volumes
 docker-compose up -d --scale <service
name>=number of instance
Set number of containers for a service
2020Prepared By Mutlu Okuducu
Docker-compose Examples
#mysql and adminer
version: '3.1'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
adminer:
image: adminer
restart: always
ports:
- 8080:8080 2020Prepared By Mutlu Okuducu

More Related Content

What's hot

Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
MANAOUIL Karim
 
Docker introduction &amp; benefits
Docker introduction &amp; benefitsDocker introduction &amp; benefits
Docker introduction &amp; benefits
Amit Manwade
 
Docker
DockerDocker
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Sparkbit
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting started
Matheus Marabesi
 
Docker basics
Docker basicsDocker basics
Docker basics
Claudio Montoya
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
Walid Ashraf
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
Gourav Varma
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Luong Vo
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
Jian Wu
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
Docker, Inc.
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
Introduction to container based virtualization with docker
Introduction to container based virtualization with dockerIntroduction to container based virtualization with docker
Introduction to container based virtualization with docker
Bangladesh Network Operators Group
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
Docker, Inc.
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Edureka!
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Pubudu Jayawardana
 
Why Docker
Why DockerWhy Docker
Why Docker
dotCloud
 

What's hot (20)

Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker introduction &amp; benefits
Docker introduction &amp; benefitsDocker introduction &amp; benefits
Docker introduction &amp; benefits
 
Docker
DockerDocker
Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting started
 
Docker basics
Docker basicsDocker basics
Docker basics
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
 
Introduction to container based virtualization with docker
Introduction to container based virtualization with dockerIntroduction to container based virtualization with docker
Introduction to container based virtualization with docker
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Why Docker
Why DockerWhy Docker
Why Docker
 

Similar to Docker

Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
PRIYADARSHINI ANAND
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
Alessandro Mignogna
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
UsamaMushtaq24
 
How to _docker
How to _dockerHow to _docker
How to _docker
Abdur Rab Marjan
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
msyukor
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podman
Thierry Gayet
 
Docker how to
Docker how toDocker how to
Docker how to
Patryk Omiotek
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
Justyna Ilczuk
 
Docker
DockerDocker
Dockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekDockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to Geek
wiTTyMinds1
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
Taswar Bhatti
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Codemotion
 
Docker
DockerDocker
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Docker
msyukor
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
DOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDESDOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDES
MuhammadAhmed651877
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 

Similar to Docker (20)

Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podman
 
Docker how to
Docker how toDocker how to
Docker how to
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker
DockerDocker
Docker
 
Dockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekDockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to Geek
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
 
Docker
DockerDocker
Docker
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Docker
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
DOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDESDOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDES
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 

Recently uploaded

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 

Recently uploaded (20)

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 

Docker

  • 1. Prepared By Mutlu Okuducu 2020 https://github.com/mutluokuducu/Docker
  • 2. • Docker is a container management service. The keywords of Docker are develop, ship and run anywhere. The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed anywhere. • Docker is an Open platform for developers and sysadmins to build, ship and run distributed applications. • It can run on most Linux distributions, Windows and Mac OS running Docker Engine (Toolbox). WHAT IS DOCKER? 2020Prepared By Mutlu Okuducu
  • 4. DOCKER FEATURES….  Light-Weight  Minimal overhead (cpu/io/network)  Based on Linux containers  Decrease storage consumption  Uses layered filesystem to save space (AUFS/LVM)  Portable  Run it Everywhere! - Linux, Mac OS or Windows operating system that has Docker installed.  Raspberry pi support.  Move from one environment to another by using the same Docker technology.  Self-sufficient  A Docker container contains everything it needs to run  Minimal Base OS  Libraries and frameworks  Application code  A Docker container should be able to run anywhere that Docker can run. 2020Prepared By Mutlu Okuducu
  • 5. IMAGES - CONTAINERS  Docker images are executable packages that include everything needed to run an application — the code, a runtime, libraries, environment variables, and configuration files.  Docker containers are a runtime instance of an image — what the image becomes in memory when executed (that is, an image with state, or a user process). 2020Prepared By Mutlu Okuducu
  • 7. MOST USED COMMANDS  docker version 2020Prepared By Mutlu Okuducu
  • 8. A-DOCKER HUB  Docker Hub is a service provided by Docker for finding and sharing container images with your team.  https://hub.docker.com/ 2020Prepared By Mutlu Okuducu
  • 9. Docker Pull docker pull nginx docker images REPOSITORY TAG IMAGE ID CREATED SIZE nginx latest f949e7d76d63 2 weeks ago 126MB  docker run --name nginx -d -p 8080:80 nginx  Mutlus-MacBook-Pro:~ mokuducu$ docker ps –a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 85a54b8a660c nginx "nginx -g 'daemon of…" About an hour ago Up 37 minutes 0.0.0.0:8080->80/tcp nginx  docker pull < image name> 2020Prepared By Mutlu Okuducu
  • 10. IMAGES COMMANDS Commands  Docker images image list  Docker images -q q − It tells the Docker command to return the Image ID’s only.  Docker run <images > Imaged run details  Docker rmi -f <image id> Force image delete  Docker history <ImageID> History of image  Docker inspect <imageid> Details of images 2020Prepared By Mutlu Okuducu
  • 11. CONTAINER COMMANDS Commands  Docker inspect <imageid containerid> Details of container  Docker stop Docker stop  Docker logs <containerid> Image logs  Docker exec <exqute command container> Docker exequte  Docker history <ImageID > History of image  docker top <ContainerID > Top container  docker stats <ContainerID > Status of container  Docker rm -f <container id> Force image delete  docker network ls List of network  docker network inspect <networkname > Details of network  docker stop $(docker ps -a -q) Stop all container  docker rm $(docker ps -a -q) Remove all container 2020Prepared By Mutlu Okuducu
  • 12. B- DOCKER FILE Dockerfile – Text file (recipe) used to create Docker images Docker file name must be Dockerfile 2020Prepared By Mutlu Okuducu
  • 13. Docker File Commands ADD copies the files from a source on the host into the container’s own filesystem at the set destination. CMD can be used for executing a specific command within the container. ENTRYPOINT sets a default application to be used every time a container is created with the image. ENV sets environment variables. EXPOSE associates a specific port to enable networking between the container and the outside world. FROM defines the base image used to start the build process. MAINTAINER defines a full name and email address of the image creator. RUN is the central executing directive for Dockerfiles. USER sets the UID (or username) which is to run the container. VOLUME is used to enable access from the container to a directory on the host machine. WORKDIR sets the path where the command, defined with CMD, is to be executed. LABEL allows you to add a label to your docker image. 2020Prepared By Mutlu Okuducu
  • 14. Build Docker File # Ubuntu FROM ubuntu MAINTAINER demousr@gmail.com RUN apt-get update RUN apt-get install –y nginx CMD [“echo”,”Image created”]  •The first line "#This is a sample Image" is a comment.  •The next line has to start with the FROM keyword. It tells docker, from which base image you want to base your image from. In our example, we are creating an image from the ubuntu image.  •The next command is the person who is going to maintain this image. Here you specify the MAINTAINER keyword and just mention the email ID.  •The RUN command is used to run instructions against the image. In our case, we first update our Ubuntu system and then install the nginx server on our ubuntu image.  •The last command is used to display a message to the user.  docker build . 2020Prepared By Mutlu Okuducu
  • 15. C- DOCKER-COMPOSE Docker Compose is used to run multiple containers as a single service. For example, suppose you had an application which required NGNIX and Redis, you could create one file Create Docker-Compose File at any location on your system  All Docker Compose files are YAML  File name docker-compose.yml Install Docker Compose: •From github (https://github.com/docker/compose/releases) •Using PIP Pip install-U docker-compose 2020Prepared By Mutlu Okuducu
  • 16. •Check docker-compose docker-compose version (-v) Check the validity of file by command  Docker-compose config Run docker-compose.yml file by command  Docker-compose up –d (d Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit.) Down Docker compose  Docker-compose down 2020Prepared By Mutlu Okuducu
  • 18. Scale scale Set number of containers for a service docker-compose up -d --scale <service name>=number of instance  docker-compose up -d --scale database=4 2020Prepared By Mutlu Okuducu
  • 19. COMPOSE COMMANDS Commands  docker-compose -help Help compose commands  docker-compose version (-v) Compose version  Docker-compose config Validate and view the Compose file  Docker-compose up –d Create and start containers  Docker-compose down Stop and remove containers, networks, images, and volumes  docker-compose up -d --scale <service name>=number of instance Set number of containers for a service 2020Prepared By Mutlu Okuducu
  • 20. Docker-compose Examples #mysql and adminer version: '3.1' services: db: image: mysql command: --default-authentication-plugin=mysql_native_password restart: always environment: MYSQL_ROOT_PASSWORD: root adminer: image: adminer restart: always ports: - 8080:8080 2020Prepared By Mutlu Okuducu