SlideShare a Scribd company logo
Docker for Web Developers:
A Sneak Peek
MOHD SYUKOR ABDUL
NOVEMBER 5, 2016
What is Docker?
2
 Docker is a platform for developing, shipping and running applications using
container virtualization technology.
 The Docker Platform consists of multiple products/tools:
 Docker Engine
 Docker Registry
 Docker Machine
 Docker Swarm
 Docker Compose
 Kitematic
 Docker for Linux
 Docker for Mac
 Docker for Windows
 Docker for Windows Server 2016
https://www.docker.com/
Why Docker?
3
Containers running on a
single machine share the
same operating system
kernel; they start instantly
and use less RAM. Images are
constructed from layered
filesystems and share
common files, making disk
usage and image downloads
much more efficient.
LIGHTWEIGHT
Docker containers are based
on open standards, enabling
containers to run on all major
Linux distributions and on
Microsoft Windows -- and on
top of any infrastructure.
OPEN
Containers isolate
applications from one
another and the underlying
infrastructure, while
providing an added layer of
protection for the application.
SECURE BY DEFAULT
Docker vs Virtual Machine
4
ContainerVirtual Machine
Docker Solution
5
 Docker enables developers and IT admins to build, ship and run
any application, anywhere.
Docker’s Architecture
6
Example Use Case: Development and Test in the Cloud
7
DEVELOPERS IT PRO
BUILD
Development Environments
SHIP
Secure Content & Collaboration
Developers
Version
control
Docker
Trusted Registry
QA / QE
Staging
Docker DataCenter
8
Docker’s Commands
9
docker info # displays system wide information of Docker
docker build # Build an image from a Dockerfile
docker images # List all images on a Docker host
docker pull # Pull an image from a Registry
docker run # Run an image
docker ps # List all running and stopped instances
docker stop # Stop a running instances
docker rm # Remove an instance
docker rmi # Remove an image
docker stats # Show running containers‘ resource usage info
docker attach # Attach to a running container
docker logs # Fetch the logs of a container
docker inspect # Return low-level information on a container or image
docker history # Show the history of an image
AND MORE at https://docs.docker.com/engine/reference/commandline/
The Secret Recipe 1: Dockerfile
10
 Dockerfiles = image build
script.
 Simple syntax for building
images.
 Automate and script the
images creation.
Dockerfile:
-------------------------------------------------------
FROM debian:jessie
ENV HTTPD_PREFIX /usr/local/apache2
ENV PATH $HTTPD_PREFIX/bin:$PATH
RUN mkdir -p "$HTTPD_PREFIX" 
&& chown www-data:www-data "$HTTPD_PREFIX"
WORKDIR $HTTPD_PREFIX
RUN apt-get update 
&& apt-get install -y --no-install-recommends 
libapr1 
libaprutil1 
libaprutil1-ldap 
libapr1-dev 
libaprutil1-dev 
libpcre++0 
libssl1.0.0 
&& rm -r /var/lib/apt/lists/*
COPY httpd-foreground /usr/local/bin/
EXPOSE 80
CMD ["httpd-foreground"]
-------------------------------------------------------
docker build -t my-apache2 .
The Secret Recipe 2: Docker Compose
11
 Compose is a tool for
defining and running multi-
container Docker
applications.
 The secret recipe is in the
docker-compose.yml file.
docker-compose.yml:
---------------------------------------------------
joomla:
image: joomla
links:
- joomladb:mysql
ports:
- 8080:80
joomladb:
image: mysql:5.6
environment:
MYSQL_ROOT_PASSWORD: example
---------------------------------------------------
docker-compose up -d
Docker for PHP Developers
12
Dockerfile:
------------------------------------------------------------------
FROM php:7.0-apache
COPY src/ /var/www/html/
------------------------------------------------------------------
 docker build -t my-php-app .
 docker run -d --name my-running-app my-php-app
Docker for Java Developers
13
Dockerfile:
------------------------------------------------------------------------
FROM jboss/wildfly
ADD your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/
------------------------------------------------------------------------
 docker build --tag=wildfly-app .
 docker run -it wildfly-app
Docker for Python Developers
14
Dockerfile:
-----------------------------------------------------------------------
FROM ubuntu:16.04
MAINTANER Your Name "youremail@domain.tld"
RUN apt-get update -y && 
apt-get install -y python-pip python-dev
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
COPY . /app
ENTRYPOINT [ "python" ]
CMD [ "app.py" ]
-----------------------------------------------------------------------
 docker build -t myflask1:latest .
 docker run -d -p 5000:5000 myflask1
Docker for Node.js Developers
15
Dockerfile:
--------------------------------------------------------------------
FROM node
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
EXPOSE 8080
CMD [ "npm", "start" ]
--------------------------------------------------------------------
 docker build -t yourname/node-web-app .
 docker run -p 49160:8080 -d yourname/node-web-app
Docker for Go Developers
16
$ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.6 bash
$ for GOOS in darwin linux; do
> for GOARCH in 386 amd64; do
> go build -v -o myapp-$GOOS-$GOARCH
> done
> done
Docker for Database Server
17
 MySQL Server:
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:8
 MariaDB Server:
docker run --name some-mariadb -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb
 Percona Server:
docker run --name some-percona -e MYSQL_ROOT_PASSWORD=my-secret-pw -d 
percona:5.7.14
 PostgreSQL Server:
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d 
postgres:9.6
 MongoDB Server:
docker run --name some-mongo -d mongo
Docker for WordPress
18
 docker run --name wordpressdb -e MYSQL_ROOT_PASSWORD=password 
-e MYSQL_DATABASE=wordpress -d mysql:5.7
 docker run -e WORDPRESS_DB_PASSWORD=password -d --name wordpress 
--link wordpressdb:mysql wordpress
Docker for Joomla
19
 docker run --name mysql1 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7
 docker run --name joomla1 --link mysql1:mysql -d joomla
 docker run --name some-joomla --link mysql1:mysql -p 8080:80 -d joomla
 docker run -d -p 80:80 -p 3306:3306 webkul/joomla:latest
Docker for Drupal
20
 docker run --name some-drupal --link some-mysql:mysql -d drupal
Docker for Apache Web Server
21
 docker run -dit --name my-apache-app 
-v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
Dockerfile:
------------------------------------------------------------------
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
OR
Docker for Nginx Web Server
22
 docker run --name docker-nginx -p 8080:80 -d 
-v ~/docker-nginx/html:/usr/share/nginx/html nginx
Docker for Caddy Web Server
23
 docker run -d -p 2015:2015 abiosoft/caddy:php
Docker for ELK Stack
24
 docker pull sebp/elk
 docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it 
--name elk sebp/elk
Docker for OS???
25
 docker pull ubuntu:16.04
 docker run ubuntu:16.04 /bin/bash
 docker run –it alpine ash
 docker run –it centos bash
 docker run –it fedora bash
 docker run ubuntu:16.04 grep -v '^#' /etc/apt/sources.list
Docker for Microsoft’s Platform???
26
 docker pull microsoft/nanoserver
 docker pull microsoft/iis
 docker pull microsoft/dotnet
 docker pull microsoft/sample-httpd
 docker pull microsoft/mssql-server-2016-express-windows
Docker Repositories
27
Official Repositories – https://hub.docker.com/explore/
Docker for Web Developers: A Sneak Peek
28
Q&A

More Related Content

What's hot

Docker dDessi november 2015
Docker dDessi november 2015Docker dDessi november 2015
Docker dDessi november 2015
Massimiliano Dessì
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Van Phuc
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
Mathieu Buffenoir
 
Docker engine - Indroduc
Docker engine - IndroducDocker engine - Indroduc
Docker engine - Indroduc
Al Gifari
 
Docker containerization cookbook
Docker containerization cookbookDocker containerization cookbook
Docker containerization cookbook
Pascal Louis
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
RightScale
 
Docker at Flux7
Docker at Flux7Docker at Flux7
Docker at Flux7
Aater Suleman
 
Faster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker PlatformFaster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker Platform
msyukor
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Justyna Ilczuk
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
Massimiliano Dessì
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Akihiro Suda
 
Docker on ARM Raspberry Pi
Docker on ARM Raspberry PiDocker on ARM Raspberry Pi
Docker on ARM Raspberry Pi
Eueung Mulyana
 
Mastering Docker on a Raspberry Pi
Mastering Docker on a Raspberry PiMastering Docker on a Raspberry Pi
Mastering Docker on a Raspberry Pi
Team Hypriot
 
DCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on KubernetesDCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on Kubernetes
Docker, Inc.
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Anthony Chu
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
Binary Studio
 

What's hot (20)

Docker dDessi november 2015
Docker dDessi november 2015Docker dDessi november 2015
Docker dDessi november 2015
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
 
Docker engine - Indroduc
Docker engine - IndroducDocker engine - Indroduc
Docker engine - Indroduc
 
Docker containerization cookbook
Docker containerization cookbookDocker containerization cookbook
Docker containerization cookbook
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
Docker at Flux7
Docker at Flux7Docker at Flux7
Docker at Flux7
 
Faster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker PlatformFaster and Easier Software Development using Docker Platform
Faster and Easier Software Development using Docker Platform
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode[DockerCon 2019] Hardening Docker daemon with Rootless mode
[DockerCon 2019] Hardening Docker daemon with Rootless mode
 
Docker on ARM Raspberry Pi
Docker on ARM Raspberry PiDocker on ARM Raspberry Pi
Docker on ARM Raspberry Pi
 
Mastering Docker on a Raspberry Pi
Mastering Docker on a Raspberry PiMastering Docker on a Raspberry Pi
Mastering Docker on a Raspberry Pi
 
DCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on KubernetesDCSF 19 Deploying Rootless buildkit on Kubernetes
DCSF 19 Deploying Rootless buildkit on Kubernetes
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
 

Similar to Docker for Web Developers: A Sneak Peek

Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
Ben Hall
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
Philip Zheng
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
Philip Zheng
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Swaminathan Vetri
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
Ben Hall
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel Application
Afrimadoni Dinata
 
MySQL on Docker - Containerizing the Dolphin
MySQL on Docker - Containerizing the DolphinMySQL on Docker - Containerizing the Dolphin
MySQL on Docker - Containerizing the Dolphin
Severalnines
 
Docker
DockerDocker
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall
 
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
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
andersjanmyr
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Docker Intro
Docker IntroDocker Intro
Docker Intro
Ruben Taelman
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
Russ Mckendrick
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
Docker, Inc.
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
Ben Hall
 
Docker^3
Docker^3Docker^3

Similar to Docker for Web Developers: A Sneak Peek (20)

Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel Application
 
MySQL on Docker - Containerizing the Dolphin
MySQL on Docker - Containerizing the DolphinMySQL on Docker - Containerizing the Dolphin
MySQL on Docker - Containerizing the Dolphin
 
Docker
DockerDocker
Docker
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
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
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Docker Intro
Docker IntroDocker Intro
Docker Intro
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker^3
Docker^3Docker^3
Docker^3
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 

Docker for Web Developers: A Sneak Peek

  • 1. Docker for Web Developers: A Sneak Peek MOHD SYUKOR ABDUL NOVEMBER 5, 2016
  • 2. What is Docker? 2  Docker is a platform for developing, shipping and running applications using container virtualization technology.  The Docker Platform consists of multiple products/tools:  Docker Engine  Docker Registry  Docker Machine  Docker Swarm  Docker Compose  Kitematic  Docker for Linux  Docker for Mac  Docker for Windows  Docker for Windows Server 2016 https://www.docker.com/
  • 3. Why Docker? 3 Containers running on a single machine share the same operating system kernel; they start instantly and use less RAM. Images are constructed from layered filesystems and share common files, making disk usage and image downloads much more efficient. LIGHTWEIGHT Docker containers are based on open standards, enabling containers to run on all major Linux distributions and on Microsoft Windows -- and on top of any infrastructure. OPEN Containers isolate applications from one another and the underlying infrastructure, while providing an added layer of protection for the application. SECURE BY DEFAULT
  • 4. Docker vs Virtual Machine 4 ContainerVirtual Machine
  • 5. Docker Solution 5  Docker enables developers and IT admins to build, ship and run any application, anywhere.
  • 7. Example Use Case: Development and Test in the Cloud 7 DEVELOPERS IT PRO BUILD Development Environments SHIP Secure Content & Collaboration Developers Version control Docker Trusted Registry QA / QE Staging
  • 9. Docker’s Commands 9 docker info # displays system wide information of Docker docker build # Build an image from a Dockerfile docker images # List all images on a Docker host docker pull # Pull an image from a Registry docker run # Run an image docker ps # List all running and stopped instances docker stop # Stop a running instances docker rm # Remove an instance docker rmi # Remove an image docker stats # Show running containers‘ resource usage info docker attach # Attach to a running container docker logs # Fetch the logs of a container docker inspect # Return low-level information on a container or image docker history # Show the history of an image AND MORE at https://docs.docker.com/engine/reference/commandline/
  • 10. The Secret Recipe 1: Dockerfile 10  Dockerfiles = image build script.  Simple syntax for building images.  Automate and script the images creation. Dockerfile: ------------------------------------------------------- FROM debian:jessie ENV HTTPD_PREFIX /usr/local/apache2 ENV PATH $HTTPD_PREFIX/bin:$PATH RUN mkdir -p "$HTTPD_PREFIX" && chown www-data:www-data "$HTTPD_PREFIX" WORKDIR $HTTPD_PREFIX RUN apt-get update && apt-get install -y --no-install-recommends libapr1 libaprutil1 libaprutil1-ldap libapr1-dev libaprutil1-dev libpcre++0 libssl1.0.0 && rm -r /var/lib/apt/lists/* COPY httpd-foreground /usr/local/bin/ EXPOSE 80 CMD ["httpd-foreground"] ------------------------------------------------------- docker build -t my-apache2 .
  • 11. The Secret Recipe 2: Docker Compose 11  Compose is a tool for defining and running multi- container Docker applications.  The secret recipe is in the docker-compose.yml file. docker-compose.yml: --------------------------------------------------- joomla: image: joomla links: - joomladb:mysql ports: - 8080:80 joomladb: image: mysql:5.6 environment: MYSQL_ROOT_PASSWORD: example --------------------------------------------------- docker-compose up -d
  • 12. Docker for PHP Developers 12 Dockerfile: ------------------------------------------------------------------ FROM php:7.0-apache COPY src/ /var/www/html/ ------------------------------------------------------------------  docker build -t my-php-app .  docker run -d --name my-running-app my-php-app
  • 13. Docker for Java Developers 13 Dockerfile: ------------------------------------------------------------------------ FROM jboss/wildfly ADD your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/ ------------------------------------------------------------------------  docker build --tag=wildfly-app .  docker run -it wildfly-app
  • 14. Docker for Python Developers 14 Dockerfile: ----------------------------------------------------------------------- FROM ubuntu:16.04 MAINTANER Your Name "youremail@domain.tld" RUN apt-get update -y && apt-get install -y python-pip python-dev COPY ./requirements.txt /app/requirements.txt WORKDIR /app RUN pip install -r requirements.txt COPY . /app ENTRYPOINT [ "python" ] CMD [ "app.py" ] -----------------------------------------------------------------------  docker build -t myflask1:latest .  docker run -d -p 5000:5000 myflask1
  • 15. Docker for Node.js Developers 15 Dockerfile: -------------------------------------------------------------------- FROM node RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app EXPOSE 8080 CMD [ "npm", "start" ] --------------------------------------------------------------------  docker build -t yourname/node-web-app .  docker run -p 49160:8080 -d yourname/node-web-app
  • 16. Docker for Go Developers 16 $ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.6 bash $ for GOOS in darwin linux; do > for GOARCH in 386 amd64; do > go build -v -o myapp-$GOOS-$GOARCH > done > done
  • 17. Docker for Database Server 17  MySQL Server: docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:8  MariaDB Server: docker run --name some-mariadb -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb  Percona Server: docker run --name some-percona -e MYSQL_ROOT_PASSWORD=my-secret-pw -d percona:5.7.14  PostgreSQL Server: docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres:9.6  MongoDB Server: docker run --name some-mongo -d mongo
  • 18. Docker for WordPress 18  docker run --name wordpressdb -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -d mysql:5.7  docker run -e WORDPRESS_DB_PASSWORD=password -d --name wordpress --link wordpressdb:mysql wordpress
  • 19. Docker for Joomla 19  docker run --name mysql1 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7  docker run --name joomla1 --link mysql1:mysql -d joomla  docker run --name some-joomla --link mysql1:mysql -p 8080:80 -d joomla  docker run -d -p 80:80 -p 3306:3306 webkul/joomla:latest
  • 20. Docker for Drupal 20  docker run --name some-drupal --link some-mysql:mysql -d drupal
  • 21. Docker for Apache Web Server 21  docker run -dit --name my-apache-app -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4 Dockerfile: ------------------------------------------------------------------ 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 OR
  • 22. Docker for Nginx Web Server 22  docker run --name docker-nginx -p 8080:80 -d -v ~/docker-nginx/html:/usr/share/nginx/html nginx
  • 23. Docker for Caddy Web Server 23  docker run -d -p 2015:2015 abiosoft/caddy:php
  • 24. Docker for ELK Stack 24  docker pull sebp/elk  docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk
  • 25. Docker for OS??? 25  docker pull ubuntu:16.04  docker run ubuntu:16.04 /bin/bash  docker run –it alpine ash  docker run –it centos bash  docker run –it fedora bash  docker run ubuntu:16.04 grep -v '^#' /etc/apt/sources.list
  • 26. Docker for Microsoft’s Platform??? 26  docker pull microsoft/nanoserver  docker pull microsoft/iis  docker pull microsoft/dotnet  docker pull microsoft/sample-httpd  docker pull microsoft/mssql-server-2016-express-windows
  • 27. Docker Repositories 27 Official Repositories – https://hub.docker.com/explore/
  • 28. Docker for Web Developers: A Sneak Peek 28 Q&A