SlideShare a Scribd company logo
Docker
Conclusion
Containerization with Docker
Muna A.H @abdimuna1
September 25, 2015
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Outline
1 Docker
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
2 Conclusion
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
#whoami
Name: @abdimuna1;
From: DAR;
Mcs: Informatic & comp Engineering;
Day Job: AIMGROUP(T) a enior Developer;
Night Job: Independent ecurity Researcher.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
What’s docker?
Docker is an open-source project that makes creating and
managing Linux containers really easy. Containers are like
extremely lightweight VMs they allow code to run in isolation from
other containers but safely share the machine resources, all without
the overhead of a hypervisor.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Docker download
Link
To download docker for both Mac OSX and Windows, follow this
link https://www.docker.com/toolbox
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Installation
Hint
By Installing the docker toolbox, you’ll have installed
docker-machine which is the docker’s daemon and docker itself as
the client, for connecting to the docker VM aka daemon or
docker-machine.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Lets check old way of doing things.
Lets install Ruby stack on ubuntu
$time apt-get install -y -q ruby1.9.1 ruby1.9.1-dev rubygems
build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
Reading package lists...
Building dependency tree...
The following extra packages will be installed:
....
Setting up libalgorithm-merge-perl (0.08-2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
real 1m22.470s
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Old . . .
Installing dependencies, aka dependencies hell
$apt-get install -y nodejs
...
E: Unable to locate package nodejs
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Starting Docker
Starting and stopping docker on OSX
To start the docker machine aka daemon on Mac os x run this
command
1. docker-machine start default
To check current machine/computer’s IP address run this
2. docker-machine env <NameOfTheMachine>
docker-machine env default
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Starting Docker
Starting and stopping docker on OSX. . .
To configure your shell run this command:
eval "$(docker-machine env default)"
Then after those 3 above steps you can run Docker by
docker run -it ubuntu bash
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Starting Docker
Starting and stopping docker on OSX. . .
Summary for starting docker on OSX
1 docker-machine start default
2 docker-machine env
3 eval "$(docker-machine env default)"
then run any container of your need
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Docker’s way
Dockerfile
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client 
libmysqlclient-dev
RUN apt-get install -y -q ruby1.9.1 
ruby1.9.1-dev rubygems1.9.1 
irb1.9.1 build-essential 
libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Docker’s way. . .
Building the app server
root:/# time docker build -t="abdimuna/appserver" .
Uploading context 92160 bytes
Step 1 : FROM ubuntu:12.04
---> 8dbd9e392a96
Step 2 : RUN apt-get update
---> Using cache
---> b55e9ee7b959
Step 3 : RUN apt-get install -y -q 
mysql-client 
libmysqlclient-dev
---> Using cache
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Docker’s way. . .
Building the app server. . .
---> dc92be6158b0
Step 4 : RUN apt-get install -y -q 
ruby1.9.1 ruby1.9.1-dev 
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
What’s an image?
An image is software you load into a container. A Docker image,
though, is capable of much more. An image can start software as
complex as a database, wait for you (or someone else) to add data,
store the data for later use.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Creation
There are two ways of creating images
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Ways of creating images
1-Dockerfile
You can build images by using Dockerfile.
2-Using tar
Building from a working machine that is running the distribution
you like to package as a base image.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Dockerfile
A Dockerfile describes the software that is baked into an image. It
isnot just ingredients tho, it can tell the software what environment
to use or what commands to run.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Dockerfile sample
Example of docker file is show below
# This image depends on ubuntu v14.04
# Ubuntu Dockerfile
#
# https://github.com/dockerfile/ubuntu
#
# Pull base image.
FROM ubuntu:14.04
# Install.
RUN 
sed -i ’s/# (.*multiverse$)/1/g’ /etc/apt/sources.list
apt-get update && 
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Dockerfile. . .
apt-get -y upgrade && 
apt-get install -y build-essential && 
apt-get install -y software-properties-common && 
apt-get install -y byobu curl git htop man unzip && 
rm -rf /var/lib/apt/lists/*
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Dockerfile. . .
# Add files.
ADD root/.bashrc /root/.bashrc
ADD root/.gitconfig /root/.gitconfig
ADD root/.scripts /root/.scripts
# Set environment variables.
ENV HOME /root
# Define working directory.
WORKDIR /root
# Define default command.
CMD ["bash"]
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Using tar
Creating an ubuntu base image
$ sudo debootstrap raring raring > /dev/null
$ sudo tar -C raring -c . | docker import - raring a29c15f1b
$ docker run raring cat /etc/lsb-release DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring DISTRIB_DESCRIPTION="Ubuntu 13.04"
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Searching images
To search an image in Docker hub
docker search <ImageName>
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Listing images
Listing images currently on the system.
$docker images
docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SI
abdimuna/ubuntu v1.1 c9866b26495d 16 hours ago 221.1 MB
ubuntu latest 91e54dfb1179 4 weeks ago 188.4 MB
hello-world latest af340544ed62 6 weeks ago 960 B
base/archlinux latest b97e110c94d9 12 weeks ago 278.8 MB
moul/emacs latest e69384926ffd 3 months ago 298.3 MB
training/webapp latest 02a8815912ca 4 months ago 348.8 MB
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Making changes
Lets login
% docker run -ti ubuntu /bin/bash
docker run -ti ubuntu /bin/bash
root@fb125040f4f6:/#
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Making changes. . .
Test curl command
curl
bash: curl: command not found
root@fb125040f4f6:/#
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Making changes. . .
Installing curl to this image
sudo apt-get update &&
sudo apt-get install curl
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Actual test
oot@f12aec10cab9:/# curl --help | less
curl --help | less
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP o ...
--anyauth Pick "any" authentication meth ...
-a, --append Append to target file when upl ...
--basic Use HTTP Basic Authentication ...
--cacert FILE CA certificate to verify peer ...
--capath DIR CA directory to verify peer ag ...
-E, --cert CERT[:PASSWD] Client certificate file a ...
--cert-type TYPE Certificate file type (DER/PE ...
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Exit from container
exit never returns!
exit
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Commiting changes
commit
docker commit -m="added curl" 72d455ea abdimuna/ubuntu:v1.1
where: 72d468f455ea = container ID
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Pushing changes
To push from development machine to remote repo
$docker push abdimuna/appserver
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
On production machine
Download the newly appserver
docker pull abdimuna/appserver
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Deleting
To delete an image
docker rmi c9866b26495d
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
What is a container
Defn
A container is a stripped-to-basics version of a Linux operating
system.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Basic commands
Some useful docker commands
Commands:
attach images pause
build import port
commit info ps
cp inspect pull
create kill push
diff load rename
events login restart
exec logout rm
export logs
history pause
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Help ?
Command usage
docker diff --help
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Port mappings
Use -P
Port mappings can be achived by starting a container with -P
option, example
docker run -d -P training/webapp python app.py
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Port mappings
Use -P . . .
Here: -d = run in background mode -P = port map 1:1 from host
to container
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Port mappings
Use -P . . .
Also you can specify by ports by
$ docker run -d -p 80:5000 training/webapp python app.py
Note: here non-capital letter -p is used where 80 port number of
the host is mapped to 5000 port of the container.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Aws config
EC2 Instance preparation
1 Launch an instance with Amazon Linux AMI.
2 Connect to your instance
3 Update the installed packages and cache on your instance
sudo yum update -y
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Aws config. . .
Installing docker. . .
1 Installing docker, Recommended Ver > 1.5.0
sudo yum install -y docker
1 Start the docker service
sudo service docker start
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Aws config. . .
User/group setup
1 Add the ec2-user to the docker group so that you can exe
Docker commands
without sudo.
sudo usermod -a -G docker ec2-user
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Aws config. . .
Post config & verification
1 Log out/in to pick up new docker permissions.
2 Verify that the ec2-user can run docker commands without
sudo.
[ec2-user]$ docker info
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Security
Containers have critical limitations in areas like OS support,
visibility, risk mitigation, administration, and orchestration. This is
especially true for the newer brands of containerization which do
not (yet) have a significant management and security ecosystem.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Whoami
Defn
Installing Docker
Images
Containers
Running services
Port mappings
AWS
Limitations
Scalability
Containers face many challenges to scale. It’s one thing to do a
Web app but it’s another thing to do a multitenant, complex
enterprise app with a lot of data of interest.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Docker
Yep
Docker truly enables a separation of concerns.
Microservices are ways to go.
Many small servers beat a few big hosts.
PPL need fast things!
Docker security is getting more attention.
Developers want to deploy apps and define infrastructure.
Muna A.H @abdimuna1 Containerization with Docker
Docker
Conclusion
Outro
~ Thanks ~
Everything happens precisely. . . !
Muna A.H @abdimuna1 Containerization with Docker

More Related Content

PPTX
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
PPTX
Docker Command Line, Using and Choosing containers
PPTX
Docker, LinuX Container
PDF
Docker by Example - Quiz
PDF
A Hands-on Introduction to Docker
PPTX
Docker : Container Virtualization
PDF
Docker fundamentals
PDF
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Command Line, Using and Choosing containers
Docker, LinuX Container
Docker by Example - Quiz
A Hands-on Introduction to Docker
Docker : Container Virtualization
Docker fundamentals

What's hot (20)

PDF
Docker Interview Questions
PPT
Amazon Web Services and Docker
PDF
Docker by Example - Basics
PDF
Using Docker For Development
PDF
Dockerfile
PDF
DCEU 18: Automating Docker Enterprise: Hands-off Install and Upgrade
PPTX
When Docker Engine 1.12 features unleashes software architecture
PDF
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
PPTX
Dockers and containers basics
PDF
Docker in practice
PPTX
Architecting .NET Applications for Docker and Container Based Deployments
PDF
From development environments to production deployments with Docker, Compose,...
PDF
Deployment Automation with Docker
PPTX
Docker Container As A Service - Mix-IT 2016
PDF
Containerizing a Web Application with Vue.js and Java
PDF
Optimizing Docker Images
PDF
Introduction To Docker
PDF
Rapid Development With Docker Compose
PDF
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
Docker Interview Questions
Amazon Web Services and Docker
Docker by Example - Basics
Using Docker For Development
Dockerfile
DCEU 18: Automating Docker Enterprise: Hands-off Install and Upgrade
When Docker Engine 1.12 features unleashes software architecture
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Dockers and containers basics
Docker in practice
Architecting .NET Applications for Docker and Container Based Deployments
From development environments to production deployments with Docker, Compose,...
Deployment Automation with Docker
Docker Container As A Service - Mix-IT 2016
Containerizing a Web Application with Vue.js and Java
Optimizing Docker Images
Introduction To Docker
Rapid Development With Docker Compose
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
Ad

Similar to Containerzation with Docker (20)

PDF
Docker
PDF
Scale Big With Docker — Moboom 2014
PDF
Docker Up and Running Introduction
PPTX
Getting Started with Docker
PDF
Introduction to Docker - Learning containerization XP conference 2016
PPTX
Docker Introductory workshop
PPTX
Novices guide to docker
PPTX
Docker and the Container Ecosystem
PDF
Docker navjot kaur
PDF
Up and running with docker
PPTX
Primi passi con Docker - ItalianCoders - 12-01-2021
PPTX
Docker presentation
PDF
A curtain-raiser to the container world Docker & Kubernetes
PPTX
docker technology in INTERNET WORLD.pptx
PDF
Présentation de Docker
PDF
docker.pdf
PDF
Docker basics
PPTX
Containerization using docker and its applications
PPTX
Containerization using docker and its applications
PPTX
Powercoders · Docker · Fall 2021.pptx
Docker
Scale Big With Docker — Moboom 2014
Docker Up and Running Introduction
Getting Started with Docker
Introduction to Docker - Learning containerization XP conference 2016
Docker Introductory workshop
Novices guide to docker
Docker and the Container Ecosystem
Docker navjot kaur
Up and running with docker
Primi passi con Docker - ItalianCoders - 12-01-2021
Docker presentation
A curtain-raiser to the container world Docker & Kubernetes
docker technology in INTERNET WORLD.pptx
Présentation de Docker
docker.pdf
Docker basics
Containerization using docker and its applications
Containerization using docker and its applications
Powercoders · Docker · Fall 2021.pptx
Ad

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
history of c programming in notes for students .pptx
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
PTS Company Brochure 2025 (1).pdf.......
VVF-Customer-Presentation2025-Ver1.9.pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Transform Your Business with a Software ERP System
Online Work Permit System for Fast Permit Processing
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Odoo POS Development Services by CandidRoot Solutions
history of c programming in notes for students .pptx
Understanding Forklifts - TECH EHS Solution
Softaken Excel to vCard Converter Software.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
CHAPTER 2 - PM Management and IT Context
2025 Textile ERP Trends: SAP, Odoo & Oracle
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
ISO 45001 Occupational Health and Safety Management System
Which alternative to Crystal Reports is best for small or large businesses.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PTS Company Brochure 2025 (1).pdf.......

Containerzation with Docker