SlideShare a Scribd company logo
1 of 30
Introduction to Docker
By
Dr. Syed Hassan Amin
VP Technology
Coeus Solutions Gmbh
Email : Hassan.amin77@gmail.com
Linkedin : https://pk.linkedin.com/in/dr-syed-hassan-amin-7994954
1
Outline
 Key Issues
 Introduction to Docker
 Docker Versus Vagrant
 Docker Concepts(Containers, images, docker enginer, commands)
 Setting up Docker Toolbox on Windows
 Docker Tools(Docker-Compose, Docker-Machine etc)
 Setting Up Wordpress Using Docker
 Setting Up Laravel Using Docker
 Setting Up an existing Laravel Project Using Docker
2
Key Issues Related to Development
Environment Setup
 Deployment on new machine is time consuming and sometimes frustrating
 Switching from one project to other is complicated for developers
 Different projects have different technology stack which are sometimes
incompatible
 Vagrant takes too much space, and computing resources
 Don’t want to deal with too many VM’s
3
Docker Versus Vagrant
 Vagrant creates Virtual Machines in minutes while Docker creates Virtual
Containers in seconds.
 Instead of providing a full Virtual Machines, like you get with Vagrant, Docker
provides you lightweight Virtual Containers, that share the same kernel and
allow to safely execute independent processes.
 Running a virtual Container is much faster than running a full virtual Machine.
4
Introduction to Docker
 Docker is a platform that allows you to “build, ship, and
run any app, anywhere.”
 Docker is an open-source engine that automates the
deployment of any application as a lightweight, portable,
self-sufficient container that will run virtually anywhere.
 Based on LXC (Linux Container), easy to use.
 It has come a long way in an incredibly short time and is
now considered a standard way of solving one of the
costliest aspects of software: deployment.
5
Docker Concepts
 Image
 Container
 Docker Engine
 Docker Compose
 Docker Machine
6
Docker Concepts
 An image is a filesystem and parameters to use at
runtime. It doesn’t have state and never changes.
 A container is a running instance of an image.
 When you run the command($ docker run hello-world),
Docker Engine:
 checked to see if you had the hello-world software image
 downloaded the image from the Docker Hub (more about the
hub later)
 loaded the image into the container and “ran” it
 Depending on how it was built, an image might run a
simple, single command and then exit. This is what Hello-
World did.
7
Introduction to Docker(Cont’d)
8
Docker Concepts(Cont’d)
 Docker Engine provides the core Docker technology that enables images and
containers.
 The Docker command has three parts.
9
Finding Docker Images
 Visit Docker Hub
https://hub.docker.com/?utm_source=getting_started_guide
&utm_medium=embedded_MacOSX&utm_campaign=find_wh
alesay
 Register and Login, Explore
10
Setting Up Docker Toolbox on Windows
 Install Docker
Toolbox(https://www.docker.com/products/docker-
toolbox)
 What’s in the Toolbox
 Docker Machine for running docker-machine commands
 Docker Engine for running the docker commands
 Docker Compose for running the docker-compose commands
 Kitematic, the Docker GUI
 A shell preconfigured for a Docker command-line environment
 Oracle VirtualBox
11
Getting Started
 Verify your installation
$ docker version
Will show you docker version
$ docker run hello-world
Will confirm your docker is working correctly
To try something more ambitious, you can run an Ubuntu
container with:
$ docker run -it ubuntu bash
12
Getting Started (Cont’d)
 Run docker ps -a to show all containers on the system.
$ docker ps –a
13
Docker Compose
 Compose is a tool for defining and running multi-container
Docker applications.
 With Compose, you use a Compose file to configure your
application’s services.
 Then, using a single command, you create and start all the
services from your configuration.
 Compose is great for development, testing, and staging
environments, as well as CI workflows.
14
Docker Compose(Cont’d)
 Using Compose is basically a three-step process.
 Define your app’s environment with a Dockerfile so it can be
reproduced anywhere.
 Define the services that make up your app in docker-
compose.yml so they can be run together in an isolated
environment.
 Lastly, run docker-compose up and Compose will start and run
your entire app.
15
Docker Compose(Cont’d)
 A docker-compose.yml looks like this:
version: '2'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
- logvolume01:/var/log
links:
- redis
redis:
image: redis
volumes:
logvolume01: {} 16
Docker Machine
 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 AWS or
Digital Ocean.
 Using docker-machine commands, you can start, inspect, stop, and restart a
managed host, upgrade the Docker client and daemon, and configure a Docker
client to talk to your host.
 Docker Engine runs natively on Linux systems.
 If you have a Linux box as your primary system, and want to run docker
commands, all you need to do is download and install Docker Engine.
 However, if you want an efficient way to provision multiple Docker hosts on a
network, in the cloud or even locally, you need Docker Machine.
17
Docker Engine and Docker Machine
 When people say “Docker” they typically mean Docker Engine, the client-server application
made up of the Docker daemon, a REST API that specifies interfaces for interacting with the
daemon, and a command line interface (CLI) client that talks to the daemon (through the REST
API wrapper).
 Docker Engine accepts docker commands from the CLI, such as docker run <image>, docker ps to
list running containers, docker images to list images, and so on.
18
Docker Engine and Docker Machine
(Cont’d)
 Docker Machine is a tool for provisioning and managing your Dockerized hosts
(hosts with Docker Engine on them).
 Typically, you install Docker Machine on your local system.
 Docker Machine has its own command line client docker-machine and the
Docker Engine client, docker.
 You can use Machine to install Docker Engine on one or more virtual systems.
 These virtual systems can be local (as when you use Machine to install and run
Docker Engine in VirtualBox on Mac or Windows) or remote (as when you use
Machine to provision Dockerized hosts on cloud providers).
 The Dockerized hosts are sometimes referred to as, managed “machines”.
19
Docker Engine and Docker Machine
(Cont’d)
20
Docker Machine Commands
 List available machines :-
$ docker-machine ls
 Use docker run to download and run busybox with a simple ‘echo’
command.
$ docker run busybox echo hello world
 Get the Docker host’s IP address using the docker-machine ip
command:
$ docker-machine ip default
21
Docker Machine Commands (Cont’d)
 If you are finished using a host for the time being, you can stop it with
docker-machine stop and later start it again with docker-machine
start.
$ docker-machine stop default
$ docker-machine start default
22
Build/Re-build Containers
 If you do any change to any dockerfile make sure you run this command, for the changes to take
effect:
$ docker-compose build
 Optionally you can specify which container to rebuild (instead of rebuilding all the containers):
$ docker-compose build {container-name}
 You might use the --no-cache option if you want full rebuilding (docker-compose build --no-
cache {container-name}).
23
Docker Wordpress Setup
1. Create an empty project directory. Give it whatever name you like.
2. This project directory will contain a docker-compose.yaml file which
will be complete in itself for a good starter wordpress project.
3. Create a docker-compose.yml file that will start your Wordpress blog
and a separate MySQL instance with a volume mount for data
persistence(https://docs.docker.com/compose/wordpress/)
4. Build the project by running docker-compose up -d from your
project directory:-
$ docker-compose up -d
24
version: '2'
services:
db:
image: mysql:5.7
volumes:
- "./.data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
links:
- db
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: wordpress
25
LaraDock VS Homestead
 LaraDock and Homestead both gives you a complete
virtual development environments
 Homestead is a tool that controls Vagrant for you (using
Homestead special commands). And Vagrant manages your Virtual
Machine.
 LaraDock is a tool that controls Docker for you (using Docker &
Docker Compose official commands). And Docker manages your
Virtual Containers.
26
Dockerizing an Existing Laravel Project
 If you already have a Laravel project, clone this repository on
your Laravel root directory :-
$ git clone https://github.com/coeus-
solutions/SmartFeedbackForms.git
 Add LaraDock as submodule :-
$ git submodule add https://github.com/LaraDock/laradock.git
 Set up .env and docker-compose.yml(database settings, port
etc)
 Change to laradock folder :-
$ docker-compose up -d nginx mysql
27
Dockerizing an Existing Laravel Project
(Cont’d)
 $ docker-compose ps
 Get into Machine
$ docker exec -it {workspace-container-id} bash
 Perform Laravel Specific Setup steps :-
$ composer install
$ composer update
$ php artisan key:generate
$ php artisan migrate
28
References
 Wordpress
https://docs.docker.com/compose/wordpress/
 Docker for Laravel
https://github.com/LaraDock/laradock
 Docker on Ubuntu
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-
docker-compose-on-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-
and-phpmyadmin-with-docker-compose-on-ubuntu-14-04
29
References
 https://docs.docker.com/engine/getstarted/
 https://docs.docker.com/docker-for-windows/
 https://blog.tutum.co/2014/11/05/how-to-use-docker-on-windows/
30

More Related Content

What's hot

Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking OverviewSreenivas Makam
 
Docker introduction &amp; benefits
Docker introduction &amp; benefitsDocker introduction &amp; benefits
Docker introduction &amp; benefitsAmit Manwade
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleKnoldus Inc.
 
Introduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainIntroduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainAjeet Singh Raina
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageejlp12
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
Docker intro
Docker introDocker intro
Docker introOleg Z
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker ComposeAjeet Singh Raina
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerInstruqt
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networkingLorenzo Fontana
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security OverviewSreenivas Makam
 

What's hot (20)

Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
 
Docker introduction &amp; benefits
Docker introduction &amp; benefitsDocker introduction &amp; benefits
Docker introduction &amp; benefits
 
Docker
DockerDocker
Docker
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Introduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainIntroduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker Captain
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker intro
Docker introDocker intro
Docker intro
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Understanding docker networking
Understanding docker networkingUnderstanding docker networking
Understanding docker networking
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security Overview
 

Viewers also liked

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerWalid Ashraf
 
Containers technologies
Containers technologiesContainers technologies
Containers technologiesJoris Bonnefoy
 
Docker containers
Docker containersDocker containers
Docker containersPau López
 
Motion Capture Technology
Motion Capture TechnologyMotion Capture Technology
Motion Capture TechnologyAl Asheer
 
Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker vishnu rao
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Jérôme Petazzoni
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technologyParvez Hassan
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technologyAnvesh Ranga
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerJérôme Petazzoni
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
Why Docker
Why DockerWhy Docker
Why DockerdotCloud
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 

Viewers also liked (14)

The Power of Docker
The Power of DockerThe Power of Docker
The Power of Docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Containers technologies
Containers technologiesContainers technologies
Containers technologies
 
Docker containers
Docker containersDocker containers
Docker containers
 
Motion Capture Technology
Motion Capture TechnologyMotion Capture Technology
Motion Capture Technology
 
Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Why Docker
Why DockerWhy Docker
Why Docker
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 

Similar to Introduction To Docker

Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Developmentmsyukor
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with dockerMichelle Liu
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentalsAlper Unal
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )Imo Inyang
 
Introduction to Dockers and containers
Introduction to Dockers and containers Introduction to Dockers and containers
Introduction to Dockers and containers Sri Padaraj M S
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdfYogeshwaran R
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
Docker
DockerDocker
DockerNarato
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to AdvanceParas Jain
 
Part 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker MachinePart 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker MachineBiswajit De
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Alessandro Mignogna
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET DevelopersTaswar Bhatti
 

Similar to Introduction To Docker (20)

Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentals
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )
 
Introduction to Dockers and containers
Introduction to Dockers and containers Introduction to Dockers and containers
Introduction to Dockers and containers
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdf
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docker
DockerDocker
Docker
 
Docker
DockerDocker
Docker
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
 
Docker
DockerDocker
Docker
 
Part 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker MachinePart 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker Machine
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
Docker
DockerDocker
Docker
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
 

More from Dr. Syed Hassan Amin

Greenplum versus redshift and actian vectorwise comparison
Greenplum versus redshift and actian vectorwise comparisonGreenplum versus redshift and actian vectorwise comparison
Greenplum versus redshift and actian vectorwise comparisonDr. Syed Hassan Amin
 
Multitier holistic Approach for urdu Nastaliq Recognition
Multitier holistic Approach for urdu Nastaliq RecognitionMultitier holistic Approach for urdu Nastaliq Recognition
Multitier holistic Approach for urdu Nastaliq RecognitionDr. Syed Hassan Amin
 
Thin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better CodeThin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better CodeDr. Syed Hassan Amin
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review ProcessDr. Syed Hassan Amin
 
Software Project Management Tips and Tricks
Software Project Management Tips and TricksSoftware Project Management Tips and Tricks
Software Project Management Tips and TricksDr. Syed Hassan Amin
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesDr. Syed Hassan Amin
 
Learning Technology Leadership from Steve Jobs
Learning Technology Leadership from Steve JobsLearning Technology Leadership from Steve Jobs
Learning Technology Leadership from Steve JobsDr. Syed Hassan Amin
 
Understanding and Managing Technical Debt
Understanding and Managing Technical DebtUnderstanding and Managing Technical Debt
Understanding and Managing Technical DebtDr. Syed Hassan Amin
 
An OCR System for recognition of Urdu text in Nastaliq Font
An OCR System for recognition of Urdu text in Nastaliq FontAn OCR System for recognition of Urdu text in Nastaliq Font
An OCR System for recognition of Urdu text in Nastaliq FontDr. Syed Hassan Amin
 

More from Dr. Syed Hassan Amin (12)

Greenplum versus redshift and actian vectorwise comparison
Greenplum versus redshift and actian vectorwise comparisonGreenplum versus redshift and actian vectorwise comparison
Greenplum versus redshift and actian vectorwise comparison
 
Laravel Unit Testing
Laravel Unit TestingLaravel Unit Testing
Laravel Unit Testing
 
Multitier holistic Approach for urdu Nastaliq Recognition
Multitier holistic Approach for urdu Nastaliq RecognitionMultitier holistic Approach for urdu Nastaliq Recognition
Multitier holistic Approach for urdu Nastaliq Recognition
 
Understandig PCA and LDA
Understandig PCA and LDAUnderstandig PCA and LDA
Understandig PCA and LDA
 
Agile Scrum Methodology
Agile Scrum MethodologyAgile Scrum Methodology
Agile Scrum Methodology
 
Thin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better CodeThin Controllers Fat Models - How to Write Better Code
Thin Controllers Fat Models - How to Write Better Code
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
 
Software Project Management Tips and Tricks
Software Project Management Tips and TricksSoftware Project Management Tips and Tricks
Software Project Management Tips and Tricks
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design Principles
 
Learning Technology Leadership from Steve Jobs
Learning Technology Leadership from Steve JobsLearning Technology Leadership from Steve Jobs
Learning Technology Leadership from Steve Jobs
 
Understanding and Managing Technical Debt
Understanding and Managing Technical DebtUnderstanding and Managing Technical Debt
Understanding and Managing Technical Debt
 
An OCR System for recognition of Urdu text in Nastaliq Font
An OCR System for recognition of Urdu text in Nastaliq FontAn OCR System for recognition of Urdu text in Nastaliq Font
An OCR System for recognition of Urdu text in Nastaliq Font
 

Recently uploaded

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 

Recently uploaded (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Introduction To Docker

  • 1. Introduction to Docker By Dr. Syed Hassan Amin VP Technology Coeus Solutions Gmbh Email : Hassan.amin77@gmail.com Linkedin : https://pk.linkedin.com/in/dr-syed-hassan-amin-7994954 1
  • 2. Outline  Key Issues  Introduction to Docker  Docker Versus Vagrant  Docker Concepts(Containers, images, docker enginer, commands)  Setting up Docker Toolbox on Windows  Docker Tools(Docker-Compose, Docker-Machine etc)  Setting Up Wordpress Using Docker  Setting Up Laravel Using Docker  Setting Up an existing Laravel Project Using Docker 2
  • 3. Key Issues Related to Development Environment Setup  Deployment on new machine is time consuming and sometimes frustrating  Switching from one project to other is complicated for developers  Different projects have different technology stack which are sometimes incompatible  Vagrant takes too much space, and computing resources  Don’t want to deal with too many VM’s 3
  • 4. Docker Versus Vagrant  Vagrant creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.  Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you lightweight Virtual Containers, that share the same kernel and allow to safely execute independent processes.  Running a virtual Container is much faster than running a full virtual Machine. 4
  • 5. Introduction to Docker  Docker is a platform that allows you to “build, ship, and run any app, anywhere.”  Docker is an open-source engine that automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere.  Based on LXC (Linux Container), easy to use.  It has come a long way in an incredibly short time and is now considered a standard way of solving one of the costliest aspects of software: deployment. 5
  • 6. Docker Concepts  Image  Container  Docker Engine  Docker Compose  Docker Machine 6
  • 7. Docker Concepts  An image is a filesystem and parameters to use at runtime. It doesn’t have state and never changes.  A container is a running instance of an image.  When you run the command($ docker run hello-world), Docker Engine:  checked to see if you had the hello-world software image  downloaded the image from the Docker Hub (more about the hub later)  loaded the image into the container and “ran” it  Depending on how it was built, an image might run a simple, single command and then exit. This is what Hello- World did. 7
  • 9. Docker Concepts(Cont’d)  Docker Engine provides the core Docker technology that enables images and containers.  The Docker command has three parts. 9
  • 10. Finding Docker Images  Visit Docker Hub https://hub.docker.com/?utm_source=getting_started_guide &utm_medium=embedded_MacOSX&utm_campaign=find_wh alesay  Register and Login, Explore 10
  • 11. Setting Up Docker Toolbox on Windows  Install Docker Toolbox(https://www.docker.com/products/docker- toolbox)  What’s in the Toolbox  Docker Machine for running docker-machine commands  Docker Engine for running the docker commands  Docker Compose for running the docker-compose commands  Kitematic, the Docker GUI  A shell preconfigured for a Docker command-line environment  Oracle VirtualBox 11
  • 12. Getting Started  Verify your installation $ docker version Will show you docker version $ docker run hello-world Will confirm your docker is working correctly To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash 12
  • 13. Getting Started (Cont’d)  Run docker ps -a to show all containers on the system. $ docker ps –a 13
  • 14. Docker Compose  Compose is a tool for defining and running multi-container Docker applications.  With Compose, you use a Compose file to configure your application’s services.  Then, using a single command, you create and start all the services from your configuration.  Compose is great for development, testing, and staging environments, as well as CI workflows. 14
  • 15. Docker Compose(Cont’d)  Using Compose is basically a three-step process.  Define your app’s environment with a Dockerfile so it can be reproduced anywhere.  Define the services that make up your app in docker- compose.yml so they can be run together in an isolated environment.  Lastly, run docker-compose up and Compose will start and run your entire app. 15
  • 16. Docker Compose(Cont’d)  A docker-compose.yml looks like this: version: '2' services: web: build: . ports: - "5000:5000" volumes: - .:/code - logvolume01:/var/log links: - redis redis: image: redis volumes: logvolume01: {} 16
  • 17. Docker Machine  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 AWS or Digital Ocean.  Using docker-machine commands, you can start, inspect, stop, and restart a managed host, upgrade the Docker client and daemon, and configure a Docker client to talk to your host.  Docker Engine runs natively on Linux systems.  If you have a Linux box as your primary system, and want to run docker commands, all you need to do is download and install Docker Engine.  However, if you want an efficient way to provision multiple Docker hosts on a network, in the cloud or even locally, you need Docker Machine. 17
  • 18. Docker Engine and Docker Machine  When people say “Docker” they typically mean Docker Engine, the client-server application made up of the Docker daemon, a REST API that specifies interfaces for interacting with the daemon, and a command line interface (CLI) client that talks to the daemon (through the REST API wrapper).  Docker Engine accepts docker commands from the CLI, such as docker run <image>, docker ps to list running containers, docker images to list images, and so on. 18
  • 19. Docker Engine and Docker Machine (Cont’d)  Docker Machine is a tool for provisioning and managing your Dockerized hosts (hosts with Docker Engine on them).  Typically, you install Docker Machine on your local system.  Docker Machine has its own command line client docker-machine and the Docker Engine client, docker.  You can use Machine to install Docker Engine on one or more virtual systems.  These virtual systems can be local (as when you use Machine to install and run Docker Engine in VirtualBox on Mac or Windows) or remote (as when you use Machine to provision Dockerized hosts on cloud providers).  The Dockerized hosts are sometimes referred to as, managed “machines”. 19
  • 20. Docker Engine and Docker Machine (Cont’d) 20
  • 21. Docker Machine Commands  List available machines :- $ docker-machine ls  Use docker run to download and run busybox with a simple ‘echo’ command. $ docker run busybox echo hello world  Get the Docker host’s IP address using the docker-machine ip command: $ docker-machine ip default 21
  • 22. Docker Machine Commands (Cont’d)  If you are finished using a host for the time being, you can stop it with docker-machine stop and later start it again with docker-machine start. $ docker-machine stop default $ docker-machine start default 22
  • 23. Build/Re-build Containers  If you do any change to any dockerfile make sure you run this command, for the changes to take effect: $ docker-compose build  Optionally you can specify which container to rebuild (instead of rebuilding all the containers): $ docker-compose build {container-name}  You might use the --no-cache option if you want full rebuilding (docker-compose build --no- cache {container-name}). 23
  • 24. Docker Wordpress Setup 1. Create an empty project directory. Give it whatever name you like. 2. This project directory will contain a docker-compose.yaml file which will be complete in itself for a good starter wordpress project. 3. Create a docker-compose.yml file that will start your Wordpress blog and a separate MySQL instance with a volume mount for data persistence(https://docs.docker.com/compose/wordpress/) 4. Build the project by running docker-compose up -d from your project directory:- $ docker-compose up -d 24
  • 25. version: '2' services: db: image: mysql:5.7 volumes: - "./.data/db:/var/lib/mysql" restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest links: - db ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress 25
  • 26. LaraDock VS Homestead  LaraDock and Homestead both gives you a complete virtual development environments  Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.  LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers. 26
  • 27. Dockerizing an Existing Laravel Project  If you already have a Laravel project, clone this repository on your Laravel root directory :- $ git clone https://github.com/coeus- solutions/SmartFeedbackForms.git  Add LaraDock as submodule :- $ git submodule add https://github.com/LaraDock/laradock.git  Set up .env and docker-compose.yml(database settings, port etc)  Change to laradock folder :- $ docker-compose up -d nginx mysql 27
  • 28. Dockerizing an Existing Laravel Project (Cont’d)  $ docker-compose ps  Get into Machine $ docker exec -it {workspace-container-id} bash  Perform Laravel Specific Setup steps :- $ composer install $ composer update $ php artisan key:generate $ php artisan migrate 28
  • 29. References  Wordpress https://docs.docker.com/compose/wordpress/  Docker for Laravel https://github.com/LaraDock/laradock  Docker on Ubuntu https://www.digitalocean.com/community/tutorials/how-to-install-and-use- docker-compose-on-ubuntu-14-04 https://www.digitalocean.com/community/tutorials/how-to-install-wordpress- and-phpmyadmin-with-docker-compose-on-ubuntu-14-04 29