SlideShare a Scribd company logo
DOCKER
Getting Started
Created By ENG/Hussien
Elhannan
hussien.elhannan@gmail.com
Theideaof containerizationvs virtualization:
Docker Engine:
•Docker engine is the core piece of software for building images and running containers
With these major components:
Docker client : is the primary way that many Docker users interact with Docker. When
you use commands such as docker run, the client sends these commands to dockerd,
which carries them out. And also the Docker client can communicate with more than
one daemon.
Docker daemon: (dockerd) listens for Docker API requests and manages Docker objects
such as images, containers, networks, and volumes. A daemon can also communicate
with other daemons to manage Docker services.
Note : The Docker client and daemon can run on the same system, or you can connect
a Docker client to a remote Docker daemon. The Docker client and daemon
communicate using a REST API, over UNIX sockets or a network interface.
Stateless App vs Stateful app :
Stateless App:
- Doesn’t keep many data
- Forward the connection and once done it forget all about it’s done and move to the
next task
- Ex : Web Servers
Stateful App:
- Keep changes and data
- Remember your connections
- Ex : Database or key Value store (is a simple database that uses
an associative array (think of a map or dictionary)
Behind the scenes, How Docker works ?
Execution
Driver
Kernel Namespaces : allow us to partition up system name spaces like process ID tree or
usr Namespaces or networking Namespaces ,…. and assign a partition to one container
and so on
Control Groups (Cgroups) : group together resources
and apply limits like QOS rules
Container A Container B Container C
Capabilities : ability to slice privileges of a root and give one of them to a user or a
container.
LibContainer : replaced the LXC as an execution drive
Between Docker engine and kernel with it’s features
Such as NameSpaces,Cgroups and Capabilities and
Not only we have control on it in contrast with LXC
You also can ship it into the Docker Daemon
Docker Registries :
- Stores Docker images such as Docker Hub and Docker Cloud are public registries that
anyone can use (#Push, Pull), and Docker is configured to look for images on Docker
Hub by default. You can even run your own private registry. If you use Docker
Datacenter (DDC), it includes Docker Trusted Registry (DTR).
- Docker Hub contain official repositories or customized
Container Orchestration :
From Docker Inc. Perspective orchestration can be done on three products:
Tutem : official Docker Platform for deploying and managing your apps in the cloud from a
pretty UI.
Tutem
Docker Images :
Image consist of layers (sometimes called images) , The Base layer which got our root
file system (all file systems and directories required to make our container stripped
down bare minimum OS ) then layer 1 for example may be nginx and layer 2 for some
Updates
Note : 1- each layer can be shared with another container separately
2- Images ~ Stopped Containers , Containers ~ Running images.
Installing Docker :
According to the Linux Distro you will find a little different steps between every distro
So we can use this script which mainly works fine on manty distros :
# wget -qo- https://get.docker.com/ | sh
+ For CentOS : we can also use # yum install –y docker
#systemctl start docker.service
+ For Ubuntu : we can also use # apt-get install –y docker.io
# service docker.io status
Docker Images commands :
- Tag image as the latest : #docker tag Image-ID name:latest
- List images stored locally : #docker images
- Pull image : #docker Pull Image-name
- Delete image : #docker rmi name:tag
- Path of stored image from HUB : /var/lib/docker/aufs or another union mount technology/…
- save new image with changes made on it or installed apps : #docker comit Image-ID new-name
- see top process on the container : #docker Top Image-ID
- push image to specific repo : 1- #docker tag Image-ID Name
2- #docker push name(username):version
- see history of commands that created the layers of image : #docker history img
Container Commands :
- Show running container #docker ps
- Show running and Stopped container #docker ps –a
- Exit from container Shell : CTRL+P+Q
- Add user to docker group and take root privileges of the container without needing
to give every user root privileges #gpasswd -a username docker
- Run container : #docker run - -name *** –it Ubuntu /bin/bash *Note : running from
stored image or image on hub
- Start container already exist : #docker start container-name
- Remove Container #docker rm container-id
- More details about container & container PID : #docker inspect image-id
- Access container without needing SSH or being in attach mode #nsenter –m –u –n –
p –i –t PID /bin/bash OR #docker-enter short-ID OR #docker-exec –it short-ID /bin/bash
Interactive-TTY or –d
(detached mode) PID 1
Docker Networking :
Docker 0 interface : it’s created after Docker Daemon start and it’s actually a bit more than just interface
It’s actually a bridge or a virtual switch created entirely inside the Linux Kernel.
++Note : To see details about Docker 0 - First #{ apt-get install bridge-utils , yum install bridge-utils }
- Second #brctl show docker 0
- Vethx interface exist in the Docker 0 bridge and its connected
to the eth0 inside the container.
- show network config file for specific container (resolve.conf, hosts) :
#ls -l /var/lib/docker/containers/container-ID
- mapping container with specific port #docker run –d –p 5001:80 - - name=web1 image-name
- linking to containers 1- #docker run - -name=src –d img-name
2- #docker run - - name=rcvr - -link=src:ali-src
-it Ubuntu:15.04 /bin/bash
++to make sure attach the rcvr and #cat /etc/hosts
Alias or
nickname
Docker File :
* Simple format Plain-Text contains instructions to build image and can be stored
anywhere for EX : 1-
2- #docker build –t hellowworld:0.1 . If we will run the command from the
same directory having the docker file.
Note : #Docker history container-id to see history of commands executed on container from Docker file
-RUN : Build time command – adding layers to image (Ex : Install Apps)
-CMD : Run time command – run commands in container at lunch time (Ex : echo hello world)
-EntryPoint : such as CMD but it can’t be overrided with any command in #docker run ….. Unless you add
-- entrypoint …..
-ENV : used to make variable with values inside container (EX : ENV var1=ping var2=8.8.8.8)
Notes :
- when we build an image , docker daemon check the build cache If it has previous
instructions (image layers) so can build faster another image.
-Volume : central directory contain the data that needed to run from more than one
container and can be created during container lunching : #docker run –it - -v /test-vol --
name=Voltainer Ubuntu:15:04 /bin/bash
-Deleting volume : #docker rm –v container-name
-we can specify which network address range we want to use for our containers by editing
in docker file vim /etc/default/docker <<< Docker_OPTS=- -bip=150.150.0.1/24
-Every container gets its own thin layer (Writable Layer) that’s slapped there right on top of
the Read-Only image layers below it and within it all changes are made like installing and
updating applications , writing new files, config changes
Next:
1- Docker-swarm(Native-Docker-Clustering)
2- Docker-AWS-using
3- Getting-started-Kubernetes
4- Running Container Clusters with Kubernetes
5- Integrating-docker-with-DevOps-automated-workflows
Created By ENG/Hussien
Elhannan

More Related Content

What's hot

Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
Megha Bansal
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on Docker
Virendra Ruhela
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
Phuc Nguyen
 
Dockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @TwitterDockerizing your applications - Docker workshop @Twitter
Dockerizing your applications - Docker workshop @Twitter
dotCloud
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
Juneyoung Oh
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
DuckDuckGo
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
Balint Pato
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Sparkbit
 
Docker architecture-04-1
Docker architecture-04-1Docker architecture-04-1
Docker architecture-04-1
Mohammadreza Amini
 
Introduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate WorkshopIntroduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate Workshop
Ajeet Singh Raina
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)
Eric Smalling
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
Ravindu Fernando
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
Walid Ashraf
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
Docker, Inc.
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
Jérôme Petazzoni
 
Containers and docker
Containers and dockerContainers and docker
Containers and docker
SUDIP GHOSH
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
Jeffrey Ellin
 

What's hot (20)

Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
 
presentation on Docker
presentation on Dockerpresentation on Docker
presentation on 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
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker architecture-04-1
Docker architecture-04-1Docker architecture-04-1
Docker architecture-04-1
 
Introduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate WorkshopIntroduction to Docker Compose | Docker Intermediate Workshop
Introduction to Docker Compose | Docker Intermediate Workshop
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
 
Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)
 
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
Containers and docker
Containers and dockerContainers and docker
Containers and docker
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 

Similar to Docker

Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
Binary Studio
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
Yigal Elefant
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
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
 
Docker
DockerDocker
How to _docker
How to _dockerHow to _docker
How to _docker
Abdur Rab Marjan
 
Tech talk on docker with demo
Tech talk on docker with demoTech talk on docker with demo
Tech talk on docker with demo
Sandeep Karnawat
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker
DockerDocker
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
UsamaMushtaq24
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
Lecture eight to be introduced in class.
Lecture eight to be introduced in class.Lecture eight to be introduced in class.
Lecture eight to be introduced in class.
nigamsajal14
 
docker.pdf
docker.pdfdocker.pdf
docker.pdf
EishaTirRaazia1
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux ContainerBalaji Rajan
 
Dockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekDockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to Geek
wiTTyMinds1
 
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 Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
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
 

Similar to Docker (20)

Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
 
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
 
Docker
DockerDocker
Docker
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Tech talk on docker with demo
Tech talk on docker with demoTech talk on docker with demo
Tech talk on docker with demo
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker
DockerDocker
Docker
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Lecture eight to be introduced in class.
Lecture eight to be introduced in class.Lecture eight to be introduced in class.
Lecture eight to be introduced in class.
 
docker.pdf
docker.pdfdocker.pdf
docker.pdf
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
 
Dockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to GeekDockers & kubernetes detailed - Beginners to Geek
Dockers & kubernetes detailed - Beginners to Geek
 
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 Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
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
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
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...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Docker

  • 1. DOCKER Getting Started Created By ENG/Hussien Elhannan hussien.elhannan@gmail.com
  • 3. Docker Engine: •Docker engine is the core piece of software for building images and running containers With these major components: Docker client : is the primary way that many Docker users interact with Docker. When you use commands such as docker run, the client sends these commands to dockerd, which carries them out. And also the Docker client can communicate with more than one daemon. Docker daemon: (dockerd) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services. Note : The Docker client and daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon. The Docker client and daemon communicate using a REST API, over UNIX sockets or a network interface.
  • 4. Stateless App vs Stateful app : Stateless App: - Doesn’t keep many data - Forward the connection and once done it forget all about it’s done and move to the next task - Ex : Web Servers Stateful App: - Keep changes and data - Remember your connections - Ex : Database or key Value store (is a simple database that uses an associative array (think of a map or dictionary)
  • 5. Behind the scenes, How Docker works ? Execution Driver
  • 6. Kernel Namespaces : allow us to partition up system name spaces like process ID tree or usr Namespaces or networking Namespaces ,…. and assign a partition to one container and so on Control Groups (Cgroups) : group together resources and apply limits like QOS rules Container A Container B Container C
  • 7. Capabilities : ability to slice privileges of a root and give one of them to a user or a container. LibContainer : replaced the LXC as an execution drive Between Docker engine and kernel with it’s features Such as NameSpaces,Cgroups and Capabilities and Not only we have control on it in contrast with LXC You also can ship it into the Docker Daemon
  • 8. Docker Registries : - Stores Docker images such as Docker Hub and Docker Cloud are public registries that anyone can use (#Push, Pull), and Docker is configured to look for images on Docker Hub by default. You can even run your own private registry. If you use Docker Datacenter (DDC), it includes Docker Trusted Registry (DTR). - Docker Hub contain official repositories or customized
  • 9. Container Orchestration : From Docker Inc. Perspective orchestration can be done on three products: Tutem : official Docker Platform for deploying and managing your apps in the cloud from a pretty UI. Tutem
  • 10. Docker Images : Image consist of layers (sometimes called images) , The Base layer which got our root file system (all file systems and directories required to make our container stripped down bare minimum OS ) then layer 1 for example may be nginx and layer 2 for some Updates Note : 1- each layer can be shared with another container separately 2- Images ~ Stopped Containers , Containers ~ Running images.
  • 11. Installing Docker : According to the Linux Distro you will find a little different steps between every distro So we can use this script which mainly works fine on manty distros : # wget -qo- https://get.docker.com/ | sh + For CentOS : we can also use # yum install –y docker #systemctl start docker.service + For Ubuntu : we can also use # apt-get install –y docker.io # service docker.io status
  • 12. Docker Images commands : - Tag image as the latest : #docker tag Image-ID name:latest - List images stored locally : #docker images - Pull image : #docker Pull Image-name - Delete image : #docker rmi name:tag - Path of stored image from HUB : /var/lib/docker/aufs or another union mount technology/… - save new image with changes made on it or installed apps : #docker comit Image-ID new-name - see top process on the container : #docker Top Image-ID - push image to specific repo : 1- #docker tag Image-ID Name 2- #docker push name(username):version - see history of commands that created the layers of image : #docker history img
  • 13. Container Commands : - Show running container #docker ps - Show running and Stopped container #docker ps –a - Exit from container Shell : CTRL+P+Q - Add user to docker group and take root privileges of the container without needing to give every user root privileges #gpasswd -a username docker - Run container : #docker run - -name *** –it Ubuntu /bin/bash *Note : running from stored image or image on hub - Start container already exist : #docker start container-name - Remove Container #docker rm container-id - More details about container & container PID : #docker inspect image-id - Access container without needing SSH or being in attach mode #nsenter –m –u –n – p –i –t PID /bin/bash OR #docker-enter short-ID OR #docker-exec –it short-ID /bin/bash Interactive-TTY or –d (detached mode) PID 1
  • 14. Docker Networking : Docker 0 interface : it’s created after Docker Daemon start and it’s actually a bit more than just interface It’s actually a bridge or a virtual switch created entirely inside the Linux Kernel. ++Note : To see details about Docker 0 - First #{ apt-get install bridge-utils , yum install bridge-utils } - Second #brctl show docker 0 - Vethx interface exist in the Docker 0 bridge and its connected to the eth0 inside the container. - show network config file for specific container (resolve.conf, hosts) : #ls -l /var/lib/docker/containers/container-ID - mapping container with specific port #docker run –d –p 5001:80 - - name=web1 image-name - linking to containers 1- #docker run - -name=src –d img-name 2- #docker run - - name=rcvr - -link=src:ali-src -it Ubuntu:15.04 /bin/bash ++to make sure attach the rcvr and #cat /etc/hosts Alias or nickname
  • 15. Docker File : * Simple format Plain-Text contains instructions to build image and can be stored anywhere for EX : 1- 2- #docker build –t hellowworld:0.1 . If we will run the command from the same directory having the docker file. Note : #Docker history container-id to see history of commands executed on container from Docker file -RUN : Build time command – adding layers to image (Ex : Install Apps) -CMD : Run time command – run commands in container at lunch time (Ex : echo hello world) -EntryPoint : such as CMD but it can’t be overrided with any command in #docker run ….. Unless you add -- entrypoint ….. -ENV : used to make variable with values inside container (EX : ENV var1=ping var2=8.8.8.8)
  • 16. Notes : - when we build an image , docker daemon check the build cache If it has previous instructions (image layers) so can build faster another image. -Volume : central directory contain the data that needed to run from more than one container and can be created during container lunching : #docker run –it - -v /test-vol -- name=Voltainer Ubuntu:15:04 /bin/bash -Deleting volume : #docker rm –v container-name -we can specify which network address range we want to use for our containers by editing in docker file vim /etc/default/docker <<< Docker_OPTS=- -bip=150.150.0.1/24 -Every container gets its own thin layer (Writable Layer) that’s slapped there right on top of the Read-Only image layers below it and within it all changes are made like installing and updating applications , writing new files, config changes
  • 17. Next: 1- Docker-swarm(Native-Docker-Clustering) 2- Docker-AWS-using 3- Getting-started-Kubernetes 4- Running Container Clusters with Kubernetes 5- Integrating-docker-with-DevOps-automated-workflows Created By ENG/Hussien Elhannan

Editor's Notes

  1. Docker Hub Link : https://hub.docker.com/