SlideShare a Scribd company logo
Docker:
A New Way to Turbocharging
Your Apps Development
MOHD SYUKOR ABDUL
29 JANUARY 2018
2
Agenda
Docker Platform Overview
Docker Workflow
Managing Docker Containers
Usage Example
33
Docker Platform
Overview
4
What is Docker?
Docker is a platform for developing, shipping and running
applications using container virtualization from development to
production both on premises and in the cloud.
Docker enables you to separate your applications from your
infrastructure so you can deliver software quickly.
https://www.docker.com/
5
Docker Containers
Docker containers wrap up a piece of
software in a complete file system that
contains everything it needs to run:
code, runtime, system tools, system
libraries – anything you can install on a
server.
This guarantees that it will always run
the same, regardless of the environment
it is running in.
6
Docker Containers AND Virtual Machines
Docker Virtual Machine
7
Docker Containers VS Virtual Machines
DockerVirtual Machine
8
Docker Containers IN Virtual Machines
Docker in Physical Server Docker in Virtual Machine
9
Why Docker?
AGILITY
Accelerate software development
and deployment and respond
instantly to customer needs.
PORTABILITY
Eliminate the “works on my
machine” once and for all. Gain
independence across on-prem and
cloud environments.
SECURITY
Deliver applications safer across the
entire lifecycle with built in security
capabilities and configurations out
of the box.
COST SAVINGS
Optimize the use of your
infrastructure resources and
streamline operations to save 50%
in total costs.
SIMPLICITY
Docker makes powerful tools for
application creation and
orchestration, accessible to
everyone.
OPENNESS
Built with open source, open
standard technology and a modular
design makes it easy to integrate
into your existing environment.
INDEPENDENCE
Docker creates a separation of
concerns between developers and
IT and between applications and
infrastructure to unlock innovation.
HYBRID CLOUD
Cloud migration, multi-cloud or
hybrid cloud infrastructure require
frictionless portability of
applications.
MICROSERVICES
Docker containers are lightweight
by design and ideal for enabling
microservices application
development.
https://www.docker.com/what-docker
https://www.docker.com/what-container
10
Docker is an Ecosystem
Docker Machine is a tool that lets you
install Docker Engine on virtual hosts, and
manage the hosts with docker-machine
commands. You can use Machine to create
Docker hosts on your local Mac or Windows
box, on your company network, in your data
center, or on cloud providers like Azure,
AWS, or Digital Ocean. Compose is a tool for defining and
running multi-container Docker
applications. With Compose, you use a
YAML file to configure your application’s
services. Then, with a single command,
you create and start all the services from
your configuration.
Current versions of Docker include swarm mode
for natively managing a cluster of Docker
Engines called a swarm. Use the Docker CLI to
create a swarm, deploy application services to
a swarm, and manage swarm behavior.
11
Docker Community Edition (Docker CE)
fedoradebian
Windows 10Mac
AzureAWS
ubuntu CentOS
12
Docker Enterprise Edition (Docker EE)
Windows Server 2016AzureAWS
ubuntu CentOS
Power, Z, Cloud
13
How to Start using Docker?
 Docker Installation
 Docker website: https://www.docker.com/
 Windows : https://docs.docker.com/docker-for-windows/
 Mac : https://docs.docker.com/docker-for-mac/
 Linux : https://docs.docker.com/engine/
 Get Started:
 https://docs.docker.com/get-started/
 https://docs.docker.com/engine/userguide/
 https://aka.ms/microservicesebook
14
Play with Docker (PWD)
• https://labs.play-with-docker.com/
 A simple, interactive and fun playground to learn Docker.
 PWD is a Docker playground which allows users to run Docker commands in
a matter of seconds.
 Under the hood Docker-in-Docker (DinD) is used to give the effect of
multiple VMs/PCs.
15
https://blog.docker.com/2017/07/best-way-learn-docker-free-play-docker-pwd/
1616
Docker Workflow
17
Docker: Some Vocabulary
Docker Image
The basis of a Docker container. Represents a full application.
Docker Container
The standard unit in which the application service resides and executes.
Registry Service (Docker Hub or Docker Trusted Registry)
Cloud or server based storage and distribution service for your images.
Docker Engine
Creates, ships and runs Docker containers deployable on a physical
or virtual, host locally, in a datacenter or cloud service provider.
Docker Volume
The storage for persisting data generated by and used by Docker containers.
18
Docker Hub (Docker CE)
19
Docker Hub: PHP
20
Docker Hub: PHP
21
Docker Store (Docker EE)
22
Docker Commands
Command Description
docker pull Pull an image or a repository from a registry
docker run Run a command in a new container
docker ps List containers
docker images List images
docker stop Stop one or more running containers
docker rm Remove one or more containers
docker rmi Remove one or more images
docker inspect Return low-level information on Docker objects
docker build Build an image from a Dockerfile
docker logs Fetch the logs of a container
docker exec Run a command in a running container
docker attach Attach local standard input, output, and error streams to a running container
23
docker run hello-world
docker pull microsoft/mssql-server-linux
docker pull splunk/splunk:7.0.0
docker run –it --name mysvr1 ubuntu:16.04 /bin/bash
docker exec –it mysvr1 /bin/bash
docker images
docker ps –a
docker run -d -e "SPLUNK_START_ARGS=--accept-license" -e "SPLUNK_USER=root" -p "8000:8000"
splunk/splunk
docker run -it --rm msyukor/pentestweb nikto –h http://www.website666.com
docker stop 4f85e883cb5d
24
CI/CD Workflow
Docker Continuous Integration and Continuous Deployment (CI/CD)
https://blog.docker.com/2016/04/cicd-with-docker-cloud/
25
Docker Architecture
26
Docker Image Docker ContainerDocker Hub
pull
push commit
run
 (OUTSIDE CONTAINER):
docker pull kalilinux/kali-linux-docker
docker run –it --name webpentest kalilinux/kali-linux-docker /bin/bash
 (INSIDE CONTAINER):
root@3b1c5d566c71:/# apt update && apt full-upgrade && apt auto-remove && apt-autoclean
root@3b1c5d566c71:/# apt install nikto nmap sqlmap
root@3b1c5d566c71:/#
( CTRL-p + CTRL-q )
 (OUTSIDE CONTAINER):
docker commit -a "msyukor" -m "My PenTest" 3b1c5 msyukor/pentest1
sha256:d4b1209acdfa3ffe9c57b8635def3c105d9613cbd884d092f1ca760af489e747
docker run –it --name newpentest msyukor/pentest1 /bin/bash
Docker Image & Docker Container
27
Running Docker Container
docker run -v /path/to/app:/app –P –-name mynginx
bitnami/nginx:latest
docker port mynginx
8443/tcp -> 0.0.0.0:32768
8080/tcp -> 0.0.0.0:32769
Open browser: http://localhost:32769
mynginx
docker run -v /path/to/app:/app –p 28080:8080 –p 28443:8443
–-name mynginx2 bitnami/nginx:latest
Open browser: http://localhost:28080
mynginx2
28
Data Persistence in Docker
 Docker container is immutable.
 Volume Container is used to store data for a Docker container.
 Volumes are the best way to persist data in Docker.
https://docs.docker.com/engine/admin/volumes/volumes/
29
Data Persistence in Docker
Use file system directories (mounting from host) during app development.
docker run –d --name app1_dev -v /home/msyukor/app88:/app bitnami/nginx:latest
easily to edit app in folder /home/msyukor/app88 at development host
TIP #1
Use docker volume for app deployment.
docker run -d --name app1_final -v myvol3:/app bitnami/nginx:latest
TIP #2
30
Docker Volume
docker volume create myvol3
docker run -d -it --name devtest -v myvol3:/app bitnami/nginx:latest
docker container inspect devtest
docker volume inspect myvol3
--------------------------------------------------------------------------------------------------------------------
docker run -v /home/msyukor/app88:/app bitnami/nginx:latest
31
Build Your Own Docker Image: Dockerfile
Dockerfile docker build command docker image
 A Dockerfile is a text document that contains all the commands you would
normally execute manually in order to build a Docker image.
 Docker can build images automatically by reading the instructions from a
Dockerfile.
 Base images are available at https://hub.docker.com/explore/
32
Dockerfile
docker build -t myname/myappname:myversion .
image name & tag/revision
current directoryusername/owner
docker build –t mampu/mymesyuarat:3.0 .
docker build –t cgso/evetting:latest .
docker build –t moe/apdm:v18 .
docker build –t mof/sppa .
docker build –t anm/epenyatagaji:20180818 .
33
Dockerfile Format
 https://docs.docker.com/engine/reference/builder/
mkdir myapp1
cd myapp1
vi Dockerfile
docker build -t myapp1 .
FROM ubuntu:latest
MAINTAINER author@gmail.com
RUN apt-get update
RUN apt-get install –y curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install –y nodejs
RUN apt-get clean all
RUN mkdir /src
WORKDIR /src
COPY . /src
EXPOSE 8080
CMD [ “npm”, ”start” ]
34
Build Your Own Stack: Docker Compose
 Compose is a tool for defining and running multi-container Docker applications.
With Compose, you use a YAML file to configure your application’s services. Then,
with a single command, you create and start all the services from your
configuration ( docker-compose –d up ).
docker-compose.yml docker-compose command docker images
YML
35
docker-compose.yml
docker compose –d up
Open browser:
http://localhost:8080
version: “3.1”
services:
joomla:
image: joomla
restart: always
links:
- joomladb:mysql
ports:
- 8080:80
environment:
JOOMLA_DB_HOST: joomladb
JOOMLA_DB_PASSWORD: joomlapasswd
volumes:
- /home/msyukor/website/joomla:/var/www/html
joomladb:
image: mysql:5.6
restart: always
environment:
MYSQL_ROOT_PASSWORD: mysqlrootpasswd
volumes:
- /home/msyukor/website/mysql:/var/lib/mysql
docker-compose.yml
joomla
mysql
36
Migrating Your Existing Apps into Docker
App Requirement Suitable?
Web based app
Command line app
Standalone native GUI app
IP based app
Needs physical hardware interfacing ports
Humongous storage size
Humongous RAM size
Humongous CPU processing
Needs for speed
App designed for cloud/SaaS
App utilised microservices architecture
TIPS
37
Migrating Your Existing Apps into Docker
Use Docker Hub: https://hub.docker.com/explore/
Choose suitable Docker image for our app.
Choose suitable Docker image tag for our app.
Create directories in development host with suitable structure for our app.
Run Docker container using the chosen Docker image and mounting directories
from the development host.
Debug and rectify the app for bugs and errors (if any).
If all good, deploy the dockerised app into the production.
T I P S
3838
Managing Docker
Containers
39
Docker DataCenter to power your on-premises CaaS
Docker DataCenter
https://blog.docker.com/2016/02/docker-datacenter-caas/
https://www.docker.com/enterprise-edition
40
Docker DataCenter
41
Kubernetes
Kubernetes is an open-source system for automating deployment,
scaling, and management of containerized applications.
 https://kubernetes.io/
 Production-Grade Container
Orchestration.
 Automated container
deployment, scaling, and
management.
42
Rancher is a complete container management platform that
makes managing and using containers in production really easy.
 http://rancher.com/
Rancher
43
Rancher
44
Portainer
Portainer is an open-source lightweight management ui which allows you to
easily manage your docker hosts or swarm clusters.
 https://portainer.io/overview.html
45
https://prometheus.io/
Prometheus is an open-source systems monitoring and alerting toolkit
for Docker. Currently, you can only monitor Docker itself. You cannot
currently monitor your application using the Docker target.
 https://docs.docker.com/engine/admin/prometheus/
Prometheus
4646
Usage Example
47
Example: PHP
Docker Hub: https://hub.docker.com/_/php/
Open browser and browse: http://localhost/
docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache
Dockerfile:
-----------------------------------------
FROM php:7.0-apache
COPY config/php.ini /usr/local/etc/php/
COPY src/ /var/www/html/
-----------------------------------------
docker build -t myapp .
docker run --name myapptest myapp
48
Example: Java
Docker Hub: https://hub.docker.com/_/openjdk/
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openjdk:7 javac Main.java
Dockerfile:
------------------------------------------------
FROM openjdk:9
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN javac Main.java
CMD ["java", "Main"]
------------------------------------------------
docker build -t javaapp10 .
docker run -it --rm --name myjavaapp1 javaapp10
49
Example: Tomcat App Server
Docker Hub: https://hub.docker.com/r/library/tomcat/
Browse: http://container-ip:8080
http://host-ip:8888
docker run -it --rm -p 8888:8080 tomcat:8.0
docker run –d -it -p 8888:8080 tomcat:8.0
50
Example: .NET
Docker Hub: https://hub.docker.com/r/microsoft/dotnet/
docker run -it --rm microsoft/dotnet
[now in the container]
mkdir app
cd app
dotnet new console
dotnet restore
dotnet run
dotnet bin/Debug/netcoreapp1.0/app.dll
dotnet publish -c Release -o out
dotnet out/app.dll
Dockerfile:
---------------------------------------------
FROM microsoft/dotnet
WORKDIR /dotnetapp
COPY project.json .
RUN dotnet restore
COPY . .
RUN dotnet publish -c Release -o out
ENTRYPOINT ["dotnet", "out/dotnetapp.dll"]
----------------------------------------------
docker build -t myapp .
docker run --name myapptest myapp
51
Example: NGINX Web Server
Docker Hub: https://hub.docker.com/_/nginx/
Open browser and browse: http://localhost:8080
docker run –d --name web1 –v /www/site1:/var/www –v
/www/site1/config:/etc/nginx/conf.d/ -p 8081:80 nginx
docker create –v /etc/nginx/conf.d –v /var/www --name web_data busybox
docker run –it --rm --volumes-from web_data ubuntu /bin/bash
docker –d –p 8080:80 –-volumes-from web_data nginx
52
Example: Apache Web Server
Docker Hub: https://hub.docker.com/_/httpd/
Open browser and browse: http://localhost:8080
Dcokerfile:
----------------------------------------------------------
FROM httpd:2.4
COPY ./public-html/ /usr/local/apache2/htdocs/
----------------------------------------------------------
docker build -t my-apache2 .
docker run -dit --name my-running-app my-apache2
docker run -dit --name my-apache-app -p 8080:80 -v
"$PWD":/usr/local/apache2/htdocs/ httpd:2.4
53
Example: IIS Web Server
Docker Hub: https://hub.docker.com/r/microsoft/iis/
Dockerfile:
--------------------------------------------------------------------------------------
FROM microsoft/iis
RUN mkdir C:site
RUN powershell -NoProfile -Command 
Import-module IISAdministration; 
New-IISSite -Name "Site" -PhysicalPath C:site -BindingInformation "*:8000:"
EXPOSE 8000
ADD content/ /site
--------------------------------------------------------------------------------------
docker build -t iis-site .
docker run -d -p 8000:8000 --name my-running-site iis-site
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" my-running-site
172.28.103.186
Open broser and browse: http://172.28.103.186:8000
54
Example: CFML
Docker Hub: https://hub.docker.com/r/lucee/lucee52-nginx/
http://www.isummation.com/blog/deploying-lucee-on-docker/
Open browser and browse:
http://localhost:8282/lucee/admin/web.cfm
docker pull lucee/lucee52-nginx
docker run -p 81:80 -p 8282:8888 -v c:/project1:/var/www -it lucee/lucee52-nginx
55
Example: GitLab
Docker Hub: https://hub.docker.com/r/gitlab/gitlab-ce/
docker run --detach 
--hostname gitlab.example.com 
--publish 443:443 --publish 80:80 --publish 22:22 
--name gitlab 
--restart always 
--volume /srv/gitlab/config:/etc/gitlab 
--volume /srv/gitlab/logs:/var/log/gitlab 
--volume /srv/gitlab/data:/var/opt/gitlab 
gitlab/gitlab-ce:latest
56
Example: ELK Stack
Docker Hub: https://hub.docker.com/r/sebp/elk/
Open browser and browse:
http://localhost:5601
docker pull sebp/elk
docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk
57
Example: Kong API Server
Docker Hub: https://hub.docker.com/_/kong/
docker pull kong
docker pull cassandra:3
docker run -d --name kong-database -p 9042:9042 cassandra:3
docker run --rm --link kong-database:kong-database -e
"KONG_DATABASE=cassandra" -e "KONG_PG_HOST=kong-database" -e
"KONG_CASSANDRA_CONTACT_POINTS=kong-database" kong kong migrations up
docker run -d --name kong --link kong-database:kong-database -e
"KONG_DATABASE=cassandra" -e "KONG_PG_HOST=kong-database" -e
"KONG_CASSANDRA_CONTACT_POINTS=kong-database" -e
"KONG_PROXY_ACCESS_LOG=/dev/stdout" -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" -e
"KONG_PROXY_ERROR_LOG=/dev/stderr" -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" -e
"KONG_ADMIN_LISTEN=0.0.0.0:8001" -e "KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444" -p
8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444 kong:latest
58
Example: TensorFlow Deep Learning
Docker Hub: https://hub.docker.com/r/tensorflow/tensorflow/
https://github.com/NVIDIA/nvidia-docker
Open browser and browse:
http://localhost:18888
http://localhost:28888
docker run -it -p 18888:8888 tensorflow/tensorflow
nvidia-docker run -it -p 28888:8888 tensorflow/tensorflow:latest-gpu
59
Example: Python Data Science
Docker Hub: https://hub.docker.com/r/jupyter/datascience-notebook/
Open browser and browse:
http://localhost:8888
docker run -it --rm -p 8888:8888 jupyter/datascience-notebook
60
Example: R Studio
Docker Hub: https://hub.docker.com/r/rocker/rstudio/
Open browser and browse:
http://localhost:8787
docker run –d -p 8787:8787 rocker/rstudio-stable
61
Example: eXo Collaboration Platform
Docker Hub: https://hub.docker.com/r/exoplatform/exo-community/
Open browser and browse:
http://localhost:8080
docker run -v exo_data:/srv/exo -p 8080:8080 exoplatform/exo-community
62
Example: PenTest
Docker Hub: https://hub.docker.com/r/kalilinux/kali-linux-docker/
docker pull kalilinux/kali-linux-docker
docker run -t -i kalilinux/kali-linux-docker /bin/bash
>> apt-get update && apt-get install metasploit-framework
63
Example: Blockchain
 http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html#install-binaries-and-docker-images
 https://medium.com/@xenonstack/blockchain-apps-deployment-using-microservices-with-dockers-edaf6b6a6fce
 https://mlgblockchain.com/hyperledger-tutorials.html
 https://developer.ibm.com/linuxone/wp-content/uploads/sites/57/blockchain-quick-start.pdf
64
Example: Crypto Coin
docker run -itd -e username=example@example.com servethehome/monero_cpu_moneropool
docker run -d --name=bitcoin-node -h bitcoind -p 8332:8332 -p 8333:8333
linuxconfig/bitcoin-node
65

More Related Content

PDF
Docker for the Internet of Things (IoT): An Introduction
msyukor
 
PDF
Faster and Easier Software Development using Docker Platform
msyukor
 
PDF
Programming IoT with Docker: How to Start?
msyukor
 
PDF
Tsunami of Technologies. Are we prepared?
msyukor
 
PDF
Dockerizing IoT Services
msyukor
 
PDF
Docker on ARM Raspberry Pi
Eueung Mulyana
 
PDF
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
 
PDF
Building Reusable Development Environments with Docker
Revelation Technologies
 
Docker for the Internet of Things (IoT): An Introduction
msyukor
 
Faster and Easier Software Development using Docker Platform
msyukor
 
Programming IoT with Docker: How to Start?
msyukor
 
Tsunami of Technologies. Are we prepared?
msyukor
 
Dockerizing IoT Services
msyukor
 
Docker on ARM Raspberry Pi
Eueung Mulyana
 
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
 
Building Reusable Development Environments with Docker
Revelation Technologies
 

What's hot (20)

PPTX
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Van Phuc
 
PDF
Real-World Docker: 10 Things We've Learned
RightScale
 
PPTX
Docker : Container Virtualization
Ranjan Baisak
 
PDF
Docker, the Future of DevOps
andersjanmyr
 
PPTX
Docker Platform and Ecosystem
Patrick Chanezon
 
PPTX
Docker and the Container Ecosystem
psconnolly
 
ODP
Docker engine - Indroduc
Al Gifari
 
PPTX
Hide your development environment and application in a container
Johan Janssen
 
PDF
Docker linuxday 2015
Massimiliano Dessì
 
PPTX
Oscon London 2016 - Docker from Development to Production
Patrick Chanezon
 
PDF
Rishidot research briefing notes Cloudscaling
Rishidot Research
 
PDF
Docker dDessi november 2015
Massimiliano Dessì
 
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Akihiro Suda
 
PDF
How to Dockerize Web Application using Docker Compose
Evoke Technologies
 
PDF
A Shift from Monolith to Microservice using Docker
Ajeet Singh Raina
 
PDF
Docker for developers
andrzejsydor
 
PDF
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
 
PDF
Introduction to Docker
JWORKS powered by Ordina
 
PDF
Rooting Out Root: User namespaces in Docker
Phil Estes
 
PPTX
Continous delivery at docker age
Adrien Blind
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Van Phuc
 
Real-World Docker: 10 Things We've Learned
RightScale
 
Docker : Container Virtualization
Ranjan Baisak
 
Docker, the Future of DevOps
andersjanmyr
 
Docker Platform and Ecosystem
Patrick Chanezon
 
Docker and the Container Ecosystem
psconnolly
 
Docker engine - Indroduc
Al Gifari
 
Hide your development environment and application in a container
Johan Janssen
 
Docker linuxday 2015
Massimiliano Dessì
 
Oscon London 2016 - Docker from Development to Production
Patrick Chanezon
 
Rishidot research briefing notes Cloudscaling
Rishidot Research
 
Docker dDessi november 2015
Massimiliano Dessì
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Akihiro Suda
 
How to Dockerize Web Application using Docker Compose
Evoke Technologies
 
A Shift from Monolith to Microservice using Docker
Ajeet Singh Raina
 
Docker for developers
andrzejsydor
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
 
Introduction to Docker
JWORKS powered by Ordina
 
Rooting Out Root: User namespaces in Docker
Phil Estes
 
Continous delivery at docker age
Adrien Blind
 
Ad

Similar to Docker: A New Way to Turbocharging Your Apps Development (20)

PDF
Containerizing Web Application with Docker
msyukor
 
PDF
Docker how to
Patryk Omiotek
 
PPTX
Docker
Narato
 
PPTX
Introduction To Docker
Dr. Syed Hassan Amin
 
PPTX
Docker container a-brief_introduction_2016-01-30
Khelender Sasan
 
PPTX
Docker Basic to Advance
Paras Jain
 
PPTX
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
PDF
Dockers & kubernetes detailed - Beginners to Geek
wiTTyMinds1
 
POTX
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Swaminathan Vetri
 
PPTX
Docker
Mutlu Okuducu
 
PPTX
Docker for .NET Developers
Taswar Bhatti
 
PDF
VMware@Night: Container & Virtualisierung
Digicomp Academy AG
 
PDF
VMware@Night Container and Virtualization
Opvizor, Inc.
 
PDF
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
PPTX
Docker for Web Developers: A Sneak Peek
msyukor
 
PDF
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
PDF
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
PDF
Docker 進階實務班
Philip Zheng
 
PPTX
Academy PRO: Docker. Part 4
Binary Studio
 
PPTX
Docker In Brief
Ritu Kamthan
 
Containerizing Web Application with Docker
msyukor
 
Docker how to
Patryk Omiotek
 
Docker
Narato
 
Introduction To Docker
Dr. Syed Hassan Amin
 
Docker container a-brief_introduction_2016-01-30
Khelender Sasan
 
Docker Basic to Advance
Paras Jain
 
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
Dockers & kubernetes detailed - Beginners to Geek
wiTTyMinds1
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Swaminathan Vetri
 
Docker for .NET Developers
Taswar Bhatti
 
VMware@Night: Container & Virtualisierung
Digicomp Academy AG
 
VMware@Night Container and Virtualization
Opvizor, Inc.
 
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
Docker for Web Developers: A Sneak Peek
msyukor
 
Running the Oracle SOA Suite Environment in a Docker Container
Guido Schmutz
 
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
Docker 進階實務班
Philip Zheng
 
Academy PRO: Docker. Part 4
Binary Studio
 
Docker In Brief
Ritu Kamthan
 
Ad

Recently uploaded (20)

PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Immersive experiences: what Pharo users do!
ESUG
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Presentation about variables and constant.pptx
kr2589474
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Immersive experiences: what Pharo users do!
ESUG
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Presentation about variables and constant.pptx
safalsingh810
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 

Docker: A New Way to Turbocharging Your Apps Development

  • 1. Docker: A New Way to Turbocharging Your Apps Development MOHD SYUKOR ABDUL 29 JANUARY 2018
  • 2. 2 Agenda Docker Platform Overview Docker Workflow Managing Docker Containers Usage Example
  • 4. 4 What is Docker? Docker is a platform for developing, shipping and running applications using container virtualization from development to production both on premises and in the cloud. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. https://www.docker.com/
  • 5. 5 Docker Containers Docker containers wrap up a piece of software in a complete file system that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.
  • 6. 6 Docker Containers AND Virtual Machines Docker Virtual Machine
  • 7. 7 Docker Containers VS Virtual Machines DockerVirtual Machine
  • 8. 8 Docker Containers IN Virtual Machines Docker in Physical Server Docker in Virtual Machine
  • 9. 9 Why Docker? AGILITY Accelerate software development and deployment and respond instantly to customer needs. PORTABILITY Eliminate the “works on my machine” once and for all. Gain independence across on-prem and cloud environments. SECURITY Deliver applications safer across the entire lifecycle with built in security capabilities and configurations out of the box. COST SAVINGS Optimize the use of your infrastructure resources and streamline operations to save 50% in total costs. SIMPLICITY Docker makes powerful tools for application creation and orchestration, accessible to everyone. OPENNESS Built with open source, open standard technology and a modular design makes it easy to integrate into your existing environment. INDEPENDENCE Docker creates a separation of concerns between developers and IT and between applications and infrastructure to unlock innovation. HYBRID CLOUD Cloud migration, multi-cloud or hybrid cloud infrastructure require frictionless portability of applications. MICROSERVICES Docker containers are lightweight by design and ideal for enabling microservices application development. https://www.docker.com/what-docker https://www.docker.com/what-container
  • 10. 10 Docker is an Ecosystem Docker Machine is a tool that lets you install Docker Engine on virtual hosts, and manage the hosts with docker-machine commands. You can use Machine to create Docker hosts on your local Mac or Windows box, on your company network, in your data center, or on cloud providers like Azure, AWS, or Digital Ocean. Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. Current versions of Docker include swarm mode for natively managing a cluster of Docker Engines called a swarm. Use the Docker CLI to create a swarm, deploy application services to a swarm, and manage swarm behavior.
  • 11. 11 Docker Community Edition (Docker CE) fedoradebian Windows 10Mac AzureAWS ubuntu CentOS
  • 12. 12 Docker Enterprise Edition (Docker EE) Windows Server 2016AzureAWS ubuntu CentOS Power, Z, Cloud
  • 13. 13 How to Start using Docker?  Docker Installation  Docker website: https://www.docker.com/  Windows : https://docs.docker.com/docker-for-windows/  Mac : https://docs.docker.com/docker-for-mac/  Linux : https://docs.docker.com/engine/  Get Started:  https://docs.docker.com/get-started/  https://docs.docker.com/engine/userguide/  https://aka.ms/microservicesebook
  • 14. 14 Play with Docker (PWD) • https://labs.play-with-docker.com/  A simple, interactive and fun playground to learn Docker.  PWD is a Docker playground which allows users to run Docker commands in a matter of seconds.  Under the hood Docker-in-Docker (DinD) is used to give the effect of multiple VMs/PCs.
  • 17. 17 Docker: Some Vocabulary Docker Image The basis of a Docker container. Represents a full application. Docker Container The standard unit in which the application service resides and executes. Registry Service (Docker Hub or Docker Trusted Registry) Cloud or server based storage and distribution service for your images. Docker Engine Creates, ships and runs Docker containers deployable on a physical or virtual, host locally, in a datacenter or cloud service provider. Docker Volume The storage for persisting data generated by and used by Docker containers.
  • 22. 22 Docker Commands Command Description docker pull Pull an image or a repository from a registry docker run Run a command in a new container docker ps List containers docker images List images docker stop Stop one or more running containers docker rm Remove one or more containers docker rmi Remove one or more images docker inspect Return low-level information on Docker objects docker build Build an image from a Dockerfile docker logs Fetch the logs of a container docker exec Run a command in a running container docker attach Attach local standard input, output, and error streams to a running container
  • 23. 23 docker run hello-world docker pull microsoft/mssql-server-linux docker pull splunk/splunk:7.0.0 docker run –it --name mysvr1 ubuntu:16.04 /bin/bash docker exec –it mysvr1 /bin/bash docker images docker ps –a docker run -d -e "SPLUNK_START_ARGS=--accept-license" -e "SPLUNK_USER=root" -p "8000:8000" splunk/splunk docker run -it --rm msyukor/pentestweb nikto –h http://www.website666.com docker stop 4f85e883cb5d
  • 24. 24 CI/CD Workflow Docker Continuous Integration and Continuous Deployment (CI/CD) https://blog.docker.com/2016/04/cicd-with-docker-cloud/
  • 26. 26 Docker Image Docker ContainerDocker Hub pull push commit run  (OUTSIDE CONTAINER): docker pull kalilinux/kali-linux-docker docker run –it --name webpentest kalilinux/kali-linux-docker /bin/bash  (INSIDE CONTAINER): root@3b1c5d566c71:/# apt update && apt full-upgrade && apt auto-remove && apt-autoclean root@3b1c5d566c71:/# apt install nikto nmap sqlmap root@3b1c5d566c71:/# ( CTRL-p + CTRL-q )  (OUTSIDE CONTAINER): docker commit -a "msyukor" -m "My PenTest" 3b1c5 msyukor/pentest1 sha256:d4b1209acdfa3ffe9c57b8635def3c105d9613cbd884d092f1ca760af489e747 docker run –it --name newpentest msyukor/pentest1 /bin/bash Docker Image & Docker Container
  • 27. 27 Running Docker Container docker run -v /path/to/app:/app –P –-name mynginx bitnami/nginx:latest docker port mynginx 8443/tcp -> 0.0.0.0:32768 8080/tcp -> 0.0.0.0:32769 Open browser: http://localhost:32769 mynginx docker run -v /path/to/app:/app –p 28080:8080 –p 28443:8443 –-name mynginx2 bitnami/nginx:latest Open browser: http://localhost:28080 mynginx2
  • 28. 28 Data Persistence in Docker  Docker container is immutable.  Volume Container is used to store data for a Docker container.  Volumes are the best way to persist data in Docker. https://docs.docker.com/engine/admin/volumes/volumes/
  • 29. 29 Data Persistence in Docker Use file system directories (mounting from host) during app development. docker run –d --name app1_dev -v /home/msyukor/app88:/app bitnami/nginx:latest easily to edit app in folder /home/msyukor/app88 at development host TIP #1 Use docker volume for app deployment. docker run -d --name app1_final -v myvol3:/app bitnami/nginx:latest TIP #2
  • 30. 30 Docker Volume docker volume create myvol3 docker run -d -it --name devtest -v myvol3:/app bitnami/nginx:latest docker container inspect devtest docker volume inspect myvol3 -------------------------------------------------------------------------------------------------------------------- docker run -v /home/msyukor/app88:/app bitnami/nginx:latest
  • 31. 31 Build Your Own Docker Image: Dockerfile Dockerfile docker build command docker image  A Dockerfile is a text document that contains all the commands you would normally execute manually in order to build a Docker image.  Docker can build images automatically by reading the instructions from a Dockerfile.  Base images are available at https://hub.docker.com/explore/
  • 32. 32 Dockerfile docker build -t myname/myappname:myversion . image name & tag/revision current directoryusername/owner docker build –t mampu/mymesyuarat:3.0 . docker build –t cgso/evetting:latest . docker build –t moe/apdm:v18 . docker build –t mof/sppa . docker build –t anm/epenyatagaji:20180818 .
  • 33. 33 Dockerfile Format  https://docs.docker.com/engine/reference/builder/ mkdir myapp1 cd myapp1 vi Dockerfile docker build -t myapp1 . FROM ubuntu:latest MAINTAINER [email protected] RUN apt-get update RUN apt-get install –y curl RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - RUN apt-get install –y nodejs RUN apt-get clean all RUN mkdir /src WORKDIR /src COPY . /src EXPOSE 8080 CMD [ “npm”, ”start” ]
  • 34. 34 Build Your Own Stack: Docker Compose  Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration ( docker-compose –d up ). docker-compose.yml docker-compose command docker images YML
  • 35. 35 docker-compose.yml docker compose –d up Open browser: http://localhost:8080 version: “3.1” services: joomla: image: joomla restart: always links: - joomladb:mysql ports: - 8080:80 environment: JOOMLA_DB_HOST: joomladb JOOMLA_DB_PASSWORD: joomlapasswd volumes: - /home/msyukor/website/joomla:/var/www/html joomladb: image: mysql:5.6 restart: always environment: MYSQL_ROOT_PASSWORD: mysqlrootpasswd volumes: - /home/msyukor/website/mysql:/var/lib/mysql docker-compose.yml joomla mysql
  • 36. 36 Migrating Your Existing Apps into Docker App Requirement Suitable? Web based app Command line app Standalone native GUI app IP based app Needs physical hardware interfacing ports Humongous storage size Humongous RAM size Humongous CPU processing Needs for speed App designed for cloud/SaaS App utilised microservices architecture TIPS
  • 37. 37 Migrating Your Existing Apps into Docker Use Docker Hub: https://hub.docker.com/explore/ Choose suitable Docker image for our app. Choose suitable Docker image tag for our app. Create directories in development host with suitable structure for our app. Run Docker container using the chosen Docker image and mounting directories from the development host. Debug and rectify the app for bugs and errors (if any). If all good, deploy the dockerised app into the production. T I P S
  • 39. 39 Docker DataCenter to power your on-premises CaaS Docker DataCenter https://blog.docker.com/2016/02/docker-datacenter-caas/ https://www.docker.com/enterprise-edition
  • 41. 41 Kubernetes Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.  https://kubernetes.io/  Production-Grade Container Orchestration.  Automated container deployment, scaling, and management.
  • 42. 42 Rancher is a complete container management platform that makes managing and using containers in production really easy.  http://rancher.com/ Rancher
  • 44. 44 Portainer Portainer is an open-source lightweight management ui which allows you to easily manage your docker hosts or swarm clusters.  https://portainer.io/overview.html
  • 45. 45 https://prometheus.io/ Prometheus is an open-source systems monitoring and alerting toolkit for Docker. Currently, you can only monitor Docker itself. You cannot currently monitor your application using the Docker target.  https://docs.docker.com/engine/admin/prometheus/ Prometheus
  • 47. 47 Example: PHP Docker Hub: https://hub.docker.com/_/php/ Open browser and browse: http://localhost/ docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache Dockerfile: ----------------------------------------- FROM php:7.0-apache COPY config/php.ini /usr/local/etc/php/ COPY src/ /var/www/html/ ----------------------------------------- docker build -t myapp . docker run --name myapptest myapp
  • 48. 48 Example: Java Docker Hub: https://hub.docker.com/_/openjdk/ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openjdk:7 javac Main.java Dockerfile: ------------------------------------------------ FROM openjdk:9 COPY . /usr/src/myapp WORKDIR /usr/src/myapp RUN javac Main.java CMD ["java", "Main"] ------------------------------------------------ docker build -t javaapp10 . docker run -it --rm --name myjavaapp1 javaapp10
  • 49. 49 Example: Tomcat App Server Docker Hub: https://hub.docker.com/r/library/tomcat/ Browse: http://container-ip:8080 http://host-ip:8888 docker run -it --rm -p 8888:8080 tomcat:8.0 docker run –d -it -p 8888:8080 tomcat:8.0
  • 50. 50 Example: .NET Docker Hub: https://hub.docker.com/r/microsoft/dotnet/ docker run -it --rm microsoft/dotnet [now in the container] mkdir app cd app dotnet new console dotnet restore dotnet run dotnet bin/Debug/netcoreapp1.0/app.dll dotnet publish -c Release -o out dotnet out/app.dll Dockerfile: --------------------------------------------- FROM microsoft/dotnet WORKDIR /dotnetapp COPY project.json . RUN dotnet restore COPY . . RUN dotnet publish -c Release -o out ENTRYPOINT ["dotnet", "out/dotnetapp.dll"] ---------------------------------------------- docker build -t myapp . docker run --name myapptest myapp
  • 51. 51 Example: NGINX Web Server Docker Hub: https://hub.docker.com/_/nginx/ Open browser and browse: http://localhost:8080 docker run –d --name web1 –v /www/site1:/var/www –v /www/site1/config:/etc/nginx/conf.d/ -p 8081:80 nginx docker create –v /etc/nginx/conf.d –v /var/www --name web_data busybox docker run –it --rm --volumes-from web_data ubuntu /bin/bash docker –d –p 8080:80 –-volumes-from web_data nginx
  • 52. 52 Example: Apache Web Server Docker Hub: https://hub.docker.com/_/httpd/ Open browser and browse: http://localhost:8080 Dcokerfile: ---------------------------------------------------------- FROM httpd:2.4 COPY ./public-html/ /usr/local/apache2/htdocs/ ---------------------------------------------------------- docker build -t my-apache2 . docker run -dit --name my-running-app my-apache2 docker run -dit --name my-apache-app -p 8080:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
  • 53. 53 Example: IIS Web Server Docker Hub: https://hub.docker.com/r/microsoft/iis/ Dockerfile: -------------------------------------------------------------------------------------- FROM microsoft/iis RUN mkdir C:site RUN powershell -NoProfile -Command Import-module IISAdministration; New-IISSite -Name "Site" -PhysicalPath C:site -BindingInformation "*:8000:" EXPOSE 8000 ADD content/ /site -------------------------------------------------------------------------------------- docker build -t iis-site . docker run -d -p 8000:8000 --name my-running-site iis-site docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" my-running-site 172.28.103.186 Open broser and browse: http://172.28.103.186:8000
  • 54. 54 Example: CFML Docker Hub: https://hub.docker.com/r/lucee/lucee52-nginx/ http://www.isummation.com/blog/deploying-lucee-on-docker/ Open browser and browse: http://localhost:8282/lucee/admin/web.cfm docker pull lucee/lucee52-nginx docker run -p 81:80 -p 8282:8888 -v c:/project1:/var/www -it lucee/lucee52-nginx
  • 55. 55 Example: GitLab Docker Hub: https://hub.docker.com/r/gitlab/gitlab-ce/ docker run --detach --hostname gitlab.example.com --publish 443:443 --publish 80:80 --publish 22:22 --name gitlab --restart always --volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest
  • 56. 56 Example: ELK Stack Docker Hub: https://hub.docker.com/r/sebp/elk/ Open browser and browse: http://localhost:5601 docker pull sebp/elk docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk
  • 57. 57 Example: Kong API Server Docker Hub: https://hub.docker.com/_/kong/ docker pull kong docker pull cassandra:3 docker run -d --name kong-database -p 9042:9042 cassandra:3 docker run --rm --link kong-database:kong-database -e "KONG_DATABASE=cassandra" -e "KONG_PG_HOST=kong-database" -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" kong kong migrations up docker run -d --name kong --link kong-database:kong-database -e "KONG_DATABASE=cassandra" -e "KONG_PG_HOST=kong-database" -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" -e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" -e "KONG_PROXY_ERROR_LOG=/dev/stderr" -e "KONG_ADMIN_ERROR_LOG=/dev/stderr" -e "KONG_ADMIN_LISTEN=0.0.0.0:8001" -e "KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444" -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444 kong:latest
  • 58. 58 Example: TensorFlow Deep Learning Docker Hub: https://hub.docker.com/r/tensorflow/tensorflow/ https://github.com/NVIDIA/nvidia-docker Open browser and browse: http://localhost:18888 http://localhost:28888 docker run -it -p 18888:8888 tensorflow/tensorflow nvidia-docker run -it -p 28888:8888 tensorflow/tensorflow:latest-gpu
  • 59. 59 Example: Python Data Science Docker Hub: https://hub.docker.com/r/jupyter/datascience-notebook/ Open browser and browse: http://localhost:8888 docker run -it --rm -p 8888:8888 jupyter/datascience-notebook
  • 60. 60 Example: R Studio Docker Hub: https://hub.docker.com/r/rocker/rstudio/ Open browser and browse: http://localhost:8787 docker run –d -p 8787:8787 rocker/rstudio-stable
  • 61. 61 Example: eXo Collaboration Platform Docker Hub: https://hub.docker.com/r/exoplatform/exo-community/ Open browser and browse: http://localhost:8080 docker run -v exo_data:/srv/exo -p 8080:8080 exoplatform/exo-community
  • 62. 62 Example: PenTest Docker Hub: https://hub.docker.com/r/kalilinux/kali-linux-docker/ docker pull kalilinux/kali-linux-docker docker run -t -i kalilinux/kali-linux-docker /bin/bash >> apt-get update && apt-get install metasploit-framework
  • 63. 63 Example: Blockchain  http://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html#install-binaries-and-docker-images  https://medium.com/@xenonstack/blockchain-apps-deployment-using-microservices-with-dockers-edaf6b6a6fce  https://mlgblockchain.com/hyperledger-tutorials.html  https://developer.ibm.com/linuxone/wp-content/uploads/sites/57/blockchain-quick-start.pdf
  • 64. 64 Example: Crypto Coin docker run -itd -e [email protected] servethehome/monero_cpu_moneropool docker run -d --name=bitcoin-node -h bitcoind -p 8332:8332 -p 8333:8333 linuxconfig/bitcoin-node
  • 65. 65