SlideShare a Scribd company logo
Docker Certified Associate (DCA)
Create by: HadiTayanloo
Phone : +98-912-8387233
Linkedin: linkedin.com/in/htayanloo/
Session 2
• Inspect images and report specific attributes using filter and format+ Lab
• Show the main parts of a Dockerfile+ Lab
• Apply a file to create a Docker image+ Lab
• Display layers of a Docker image
• Use CLI commands such as list, delete, prune, rmi, etc to manage images+ Lab
Docker Command
Docker Get Image from Dockerhub.
Run : docker run hello-world
Docker Command
View Docker image (hello-world) from Dockerhub.
Run : docker image ls OR docker images
Switch:
docker images -a > show all images
docker images -q > show ONLY Image ID
Docker Command
Docker Container Execute and Input to Container .
Run : docker run -it IMAGE:TAG
Run : docker run -it centos:latest
Switch:
docker images -a > show all images
docker images -q > show ONLY Image ID
Docker Command
Docker Container Process Info
Run : docker ps
Switch:
docker ps -a
Docker Command
• Docker Container ExecuteWithout Input to Container
• Run : docker run -it -d centos:latest /bin/bash
Switch:
Docker Command
• Docker Container Process OLNY UP
• Run : docker run -it -d centos:latest
Switch:
Docker Command
• Docker Container Process OLNY UP and Image Size
• Run : docker ps -s
Switch:
Docker Command
• Docker Container Process Number of LAST Create Container (UP or Down)
• Run : docker ps –n=3
Switch:
Docker Command
• Docker Container Remove if Down Container
• Run : docker rm container_id
Switch:
Docker Command
• Docker Container Remove if UP Container
• Run : docker rm -f 21439f50a158
Switch:
Docker Command
• For Remove Container Use Container ID or Container Name
• Run : docker rm -f modest_kilby
Switch:
Docker Command
• For Remove ALL Container UP or Down
• Run : docker rm -f $(docker ps -aq)
Switch:
Docker Command
• Copy File Docker to Container :
• Run : docker run -it centos:latest /bin/bash
• Run : touch ali
• Run : docker cp ali container_id:/root
Switch:
Docker Command
• Copy Folder and SubFolder Docker to Container
• Run : docker cp folder1/ 6e7bb89e0f03:/root/
Switch:
Docker Command
• Copy Files Docker to ContainerWith Archive mode (copy all uid/gid
information) :
Run : adduser ali
Run : chown ali. file1
Run : cat /etc/passwd | grep ali
Run : docker cp -a file1 6e7bb89e0f03:/root/
Switch:
Docker Command
• Docker Stop , Start and Attach Container
Run : docker stop f75ef67694e2 Stop ContainerWithout Delete Container ID
Run : docker start f75ef67694e2 Start OLD Stop Container ID
Run : docker attach f75ef67694e2 attach = execute OLD Container ID Started
Switch:
Docker Command
• Assign CPUs to Docker Container and RUN.
Run : docker run -it --cpuset-cpus=1 centos:latest
Run : yes > /dev/null &
Run : top + 1
Switch:
Docker Command
• Assign CPUs to Docker Container and RUN
Run : docker run -it --cpuset-cpus="1,2" centos:latest
Run : docker run -it --cpuset-cpus="0-2" centos:latest
Switch:
Docker Command
• Remove shutdown container :
Run : docker rm $(docker ps -a -q -f status=exited)
Run : docker run -it --cpuset-cpus="0-2" centos:latest
Switch:
Docker Command
• -e or –env=Variable Run with Set EnvironmentVariable
Run : exportVAR1=val1
Run : docker run -it --envVAR1 centos:latest
RUN in Container: echo $VAR1
Switch:
Docker Command
• Set NameTo Container
Run : docker run -it --name MyContainer centos:latest
NOTE 1 : Do Not Change Container HostName in Path :
Run : cat
/var/lib/docker/containers/b6ff0a90da1033a0039615a6d57d522622d02625988
d98163f6a9c4f1f82dd47/hostname
Switch:
Docker Command
• Connent to Container UP and Run in Background with option exec
Run : docker exec -it test /bin/bash
Run docker exec -it 335a5485795b /bin/bash
Switch:
Docker Command
• Start Docker Container with name and Running top command startup ?
Run : docker run -d --name topdemo centos:latest /usr/bin/top –b
Run docker attach topdemo
Switch:
Docker Command
• Docker Create and Run
Run : docker create -t -i centos:latest bash
Run docker ps -a
Run docker start -ai 694f29658210
Switch:
Docker Command
• Docker Create and RunWith / Storage 120GB
Run : docker create -t -i --storage-opt size=120G centos:latest bash
Run docker start -ai e69268cee881
Switch:
Docker Command
• Docker Create and RunWith /dev/shm Storage 128M
Run : docker create -t -i --shm-size 128M centos:latest bash
Switch:
Docker Command
• ONLY Download Container Images from DockerHub
Run : docker pull ubuntu
Switch:
Docker Command
• Remove Container Images
Run docker rmi ubuntu
Switch:
Docker Command
• Remove Container Images in Used
Run docker rm -f 5740ecfdd66f
Run docker rmi centos
Switch:
Docker Command
• Change Container Images and Commit Status
Run docker commit bb04f0602188 centos:myversion
Run docker run -it centos:myversion
Switch:
Docker Command
• Change Container Images and Save Status For Other Docker Machine:
Run docker save -o centos_file.tar.gz 84684fbb5ff5
OR
Run docker save -o centos_file.tar.gz centos:myversion
Run docker load -i centos_file.tar.gz
OR
Run docker load < centos_file.tar.gz
Switch:
Aufs
Layered Architecture
FROM ubuntu
RUN apt-get update && apt-get -y install python
RUN pip install flask flask-mysql
COPY . /opt/source-code
ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run
Docker build Dockerfile –t htayanloo/myapp
Layer 1. Base ubuntu Layer
Layer 2. Changes in apt packages
Layer 3. Change in pip packages
Layer 4. Source Code
Layer 5. Update Entrypoint
120MB
306 MB
6.3 MB
229 B
0 B
FROM ubuntu
RUN apt-get update && apt-get -y install python
RUN pip install flask flask-mysql
COPY . /opt/source-code
ENTRYPOINT FLASK_APP=/opt/source-code/app2.py flask run
Docker build Dockerfile –t htayanloo/myapp-2
Layer 1. Base ubuntu Layer
Layer 2. Changes in apt packages
Layer 3. Change in pip packages
Layer 4. Source Code
Layer 5. Update Entrypoint
120MB
306 MB
6.3 MB
229 B
0 B
Layered Architecture
Layer 1. Base ubuntu Layer
Layer 2. Changes in apt packages
Layer 3. Change in pip packages
Layer 4. Source Code
Layer 5. Update Entrypoint
Image Layers
Docker build Dockerfile –t htayanloo/myapp
Docker run htayanloo/myapp
Layer 6. Container Layer
Container Layers
Image Layers
Container Layers
App.py
temp.txt
App.py

More Related Content

What's hot

Intro To Docker
Intro To DockerIntro To Docker
Intro To Docker
Jessica Lucci
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQdotCloud
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect Match
Matthias Grüter
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Walid Ashraf
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
dotCloud
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJohn Willis
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
Ryan Hodgin
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
Ben Hall
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
Docker, Inc.
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
Are VM Passé?
Are VM Passé? Are VM Passé?
Are VM Passé?
dotCloud
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
Lalatendu Mohanty
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
Michał Kurzeja
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
dotCloud
 
Introduction of Docker and Docker Compose
Introduction of Docker and Docker ComposeIntroduction of Docker and Docker Compose
Introduction of Docker and Docker Compose
Dr. Ketan Parmar
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
Phuc Nguyen
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Sparkbit
 
Introduction to docker security
Introduction to docker securityIntroduction to docker security
Introduction to docker security
Walid Ashraf
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
POSSCON
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
dotCloud
 

What's hot (20)

Intro To Docker
Intro To DockerIntro To Docker
Intro To Docker
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQ
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect Match
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
 
Are VM Passé?
Are VM Passé? Are VM Passé?
Are VM Passé?
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
 
Introduction of Docker and Docker Compose
Introduction of Docker and Docker ComposeIntroduction of Docker and Docker Compose
Introduction of Docker and Docker Compose
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to docker security
Introduction to docker securityIntroduction to docker security
Introduction to docker security
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
 

Similar to DCA. certificate slide Session 2

Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kuan Yen Heng
 
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
 
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
Mukta Aphale
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
Ganesh Samarthyam
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfile
cawamata
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Docker, Inc.
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud
 
Docker
DockerDocker
Docker workshop
Docker workshopDocker workshop
Docker workshopEvans Ye
 
Dockers Containers in action Slide 0 to hero
Dockers Containers in action Slide  0 to heroDockers Containers in action Slide  0 to hero
Dockers Containers in action Slide 0 to hero
TayyabAslam24
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
CodeOps Technologies LLP
 
Docker, but what it is?
Docker, but what it is?Docker, but what it is?
Docker, but what it is?
Julien Maitrehenry
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Ontico
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
1 docker first_linux_container_hands_on
1 docker first_linux_container_hands_on 1 docker first_linux_container_hands_on
1 docker first_linux_container_hands_on
FEG
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
Ganesh Samarthyam
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
CodeOps Technologies LLP
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
psconnolly
 
Docker
DockerDocker
Docker
Cary Gordon
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 

Similar to DCA. certificate slide Session 2 (20)

Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
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
 
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfile
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
 
Docker
DockerDocker
Docker
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Dockers Containers in action Slide 0 to hero
Dockers Containers in action Slide  0 to heroDockers Containers in action Slide  0 to hero
Dockers Containers in action Slide 0 to hero
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker, but what it is?
Docker, but what it is?Docker, but what it is?
Docker, but what it is?
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
1 docker first_linux_container_hands_on
1 docker first_linux_container_hands_on 1 docker first_linux_container_hands_on
1 docker first_linux_container_hands_on
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
 
Docker
DockerDocker
Docker
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 

DCA. certificate slide Session 2

  • 1. Docker Certified Associate (DCA) Create by: HadiTayanloo Phone : +98-912-8387233 Linkedin: linkedin.com/in/htayanloo/
  • 2. Session 2 • Inspect images and report specific attributes using filter and format+ Lab • Show the main parts of a Dockerfile+ Lab • Apply a file to create a Docker image+ Lab • Display layers of a Docker image • Use CLI commands such as list, delete, prune, rmi, etc to manage images+ Lab
  • 3. Docker Command Docker Get Image from Dockerhub. Run : docker run hello-world
  • 4. Docker Command View Docker image (hello-world) from Dockerhub. Run : docker image ls OR docker images Switch: docker images -a > show all images docker images -q > show ONLY Image ID
  • 5. Docker Command Docker Container Execute and Input to Container . Run : docker run -it IMAGE:TAG Run : docker run -it centos:latest Switch: docker images -a > show all images docker images -q > show ONLY Image ID
  • 6. Docker Command Docker Container Process Info Run : docker ps Switch: docker ps -a
  • 7. Docker Command • Docker Container ExecuteWithout Input to Container • Run : docker run -it -d centos:latest /bin/bash Switch:
  • 8. Docker Command • Docker Container Process OLNY UP • Run : docker run -it -d centos:latest Switch:
  • 9. Docker Command • Docker Container Process OLNY UP and Image Size • Run : docker ps -s Switch:
  • 10. Docker Command • Docker Container Process Number of LAST Create Container (UP or Down) • Run : docker ps –n=3 Switch:
  • 11. Docker Command • Docker Container Remove if Down Container • Run : docker rm container_id Switch:
  • 12. Docker Command • Docker Container Remove if UP Container • Run : docker rm -f 21439f50a158 Switch:
  • 13. Docker Command • For Remove Container Use Container ID or Container Name • Run : docker rm -f modest_kilby Switch:
  • 14. Docker Command • For Remove ALL Container UP or Down • Run : docker rm -f $(docker ps -aq) Switch:
  • 15. Docker Command • Copy File Docker to Container : • Run : docker run -it centos:latest /bin/bash • Run : touch ali • Run : docker cp ali container_id:/root Switch:
  • 16. Docker Command • Copy Folder and SubFolder Docker to Container • Run : docker cp folder1/ 6e7bb89e0f03:/root/ Switch:
  • 17. Docker Command • Copy Files Docker to ContainerWith Archive mode (copy all uid/gid information) : Run : adduser ali Run : chown ali. file1 Run : cat /etc/passwd | grep ali Run : docker cp -a file1 6e7bb89e0f03:/root/ Switch:
  • 18. Docker Command • Docker Stop , Start and Attach Container Run : docker stop f75ef67694e2 Stop ContainerWithout Delete Container ID Run : docker start f75ef67694e2 Start OLD Stop Container ID Run : docker attach f75ef67694e2 attach = execute OLD Container ID Started Switch:
  • 19. Docker Command • Assign CPUs to Docker Container and RUN. Run : docker run -it --cpuset-cpus=1 centos:latest Run : yes > /dev/null & Run : top + 1 Switch:
  • 20. Docker Command • Assign CPUs to Docker Container and RUN Run : docker run -it --cpuset-cpus="1,2" centos:latest Run : docker run -it --cpuset-cpus="0-2" centos:latest Switch:
  • 21. Docker Command • Remove shutdown container : Run : docker rm $(docker ps -a -q -f status=exited) Run : docker run -it --cpuset-cpus="0-2" centos:latest Switch:
  • 22. Docker Command • -e or –env=Variable Run with Set EnvironmentVariable Run : exportVAR1=val1 Run : docker run -it --envVAR1 centos:latest RUN in Container: echo $VAR1 Switch:
  • 23. Docker Command • Set NameTo Container Run : docker run -it --name MyContainer centos:latest NOTE 1 : Do Not Change Container HostName in Path : Run : cat /var/lib/docker/containers/b6ff0a90da1033a0039615a6d57d522622d02625988 d98163f6a9c4f1f82dd47/hostname Switch:
  • 24. Docker Command • Connent to Container UP and Run in Background with option exec Run : docker exec -it test /bin/bash Run docker exec -it 335a5485795b /bin/bash Switch:
  • 25. Docker Command • Start Docker Container with name and Running top command startup ? Run : docker run -d --name topdemo centos:latest /usr/bin/top –b Run docker attach topdemo Switch:
  • 26. Docker Command • Docker Create and Run Run : docker create -t -i centos:latest bash Run docker ps -a Run docker start -ai 694f29658210 Switch:
  • 27. Docker Command • Docker Create and RunWith / Storage 120GB Run : docker create -t -i --storage-opt size=120G centos:latest bash Run docker start -ai e69268cee881 Switch:
  • 28. Docker Command • Docker Create and RunWith /dev/shm Storage 128M Run : docker create -t -i --shm-size 128M centos:latest bash Switch:
  • 29. Docker Command • ONLY Download Container Images from DockerHub Run : docker pull ubuntu Switch:
  • 30. Docker Command • Remove Container Images Run docker rmi ubuntu Switch:
  • 31. Docker Command • Remove Container Images in Used Run docker rm -f 5740ecfdd66f Run docker rmi centos Switch:
  • 32. Docker Command • Change Container Images and Commit Status Run docker commit bb04f0602188 centos:myversion Run docker run -it centos:myversion Switch:
  • 33. Docker Command • Change Container Images and Save Status For Other Docker Machine: Run docker save -o centos_file.tar.gz 84684fbb5ff5 OR Run docker save -o centos_file.tar.gz centos:myversion Run docker load -i centos_file.tar.gz OR Run docker load < centos_file.tar.gz Switch:
  • 34. Aufs
  • 35. Layered Architecture FROM ubuntu RUN apt-get update && apt-get -y install python RUN pip install flask flask-mysql COPY . /opt/source-code ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run Docker build Dockerfile –t htayanloo/myapp Layer 1. Base ubuntu Layer Layer 2. Changes in apt packages Layer 3. Change in pip packages Layer 4. Source Code Layer 5. Update Entrypoint 120MB 306 MB 6.3 MB 229 B 0 B FROM ubuntu RUN apt-get update && apt-get -y install python RUN pip install flask flask-mysql COPY . /opt/source-code ENTRYPOINT FLASK_APP=/opt/source-code/app2.py flask run Docker build Dockerfile –t htayanloo/myapp-2 Layer 1. Base ubuntu Layer Layer 2. Changes in apt packages Layer 3. Change in pip packages Layer 4. Source Code Layer 5. Update Entrypoint 120MB 306 MB 6.3 MB 229 B 0 B
  • 36. Layered Architecture Layer 1. Base ubuntu Layer Layer 2. Changes in apt packages Layer 3. Change in pip packages Layer 4. Source Code Layer 5. Update Entrypoint Image Layers Docker build Dockerfile –t htayanloo/myapp Docker run htayanloo/myapp Layer 6. Container Layer Container Layers