SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Introduction To Docker
Build and Ship Application with Docker
By -
Ram Awadh Chauhan
Senior Software Engineer
Atlogys Technical Consulting
Today’s Agenda
1: About docker
2: Difference between Virtualization and Containerization.
3: Why Docker?
4: Docker Architecture, basic terms and commands
5: Dockerizing a project with docker (Django App, live Demo, Volume mount Etc)
● Environment variables (ADD, COPY, ENV, EXPOSE, FROM, WORKDIR,
ENTRYPOINT, CMD)
https://docs.docker.com/engine/reference/builder/#environment-replacement
● Differences b/w CMD and ENTRYPOINT with example
● Create a DockerFile
● Build an Image
● Run the Application
● Volume mount from Host machine to container
● Start, Stop , Delete, Remove commands
7: Who are using it?
8: Q & A sessions.
About Docker
1: Docker is a computer program that performs operating-system-level virtualization also
known as containerization.
2: Docker firstly started by “Solomon Hykes” in france as internal Project inside dotCloud.
3: It was first released in March 2013 as open source Project.
4: Docker is written in GO language.
5: It was primarily supported only Linux operating system where it used the resource
isolation feature of linux kernel.
6: Docker is used to run software packages called "containers".
7: In a typical example use case, one container runs a web server and web application,
while a second container runs a database server that is used by the web application.
8: Containers are isolated from each others and use their own set of tools and libraries.
9: Containers can communicate through well-defined channels.
10: All containers use the same kernel and are therefore more lightweight than virtual
machines.
Difference between Virtualization and
Containerization
Virtualization Containerization
Why Docker?
1: Light weight: Docker container are light weight, only include binaries of the
application.
2: Efficient: Minimizes deployment cost and it is very efficient.
3: Fixes Environment based Issue: Removes the environment based issues, like
code is working on some environment and not working on some other environments.
4: Very Flexible: Can be ported on any environment by pulling. Copying from one
environment to another environment even can be run inside Amazon EC2 and
Google Compute Engine instance also on VMS.
5: Isolation: Docker makes sure each container has its own resources that are
isolated from other containers.
Docker Architecture, Basic Terms and
Commands
Docker Architecture, Basic Terms and
Commands …. Continued
Docker Client: This (docker Client) is the primary way by which docker user interact with
docker i.e. docker run
Docker Registries: Docker registry stores docker images. Docker hub and Docker
Cloud are public registries that anyone can use, and Docker is configured to look for
images on Docker hub by default. Docker pull <image-name> can be used to pull the
images. And Docker push <mage=name > to publish docker images on docker hub.
Docker Images: An Image is a read-only template with instructions for creating a Docker
container.
Docker Container: A Container is a runnable instance of an Image. These can be
created, started, stopped or deleted using docker Api or CLI commands.
Docker Architecture, Basic Terms and
Commands …. Continued
List of important commands which can be used by Docker CLI:
1. docker pull: Pull a image from registry
2. Docker build : build and image from dockerfile
3. Docker run: Runs a container
4. docker start: Start one or more stoped container
5. docker stop: Stop one or more running containers
6. docker ps: List containers which are running
7. docker ps -a: List all containers
8. docker kill: Kill one or more running containers
9. docker logs: Fetch the logs of a container
10. docker login: Login into Docker registry like Docker hub
11. docker logout: Logout from the Docker registry
Docker Architecture, Basic Terms and
Commands …. Continued
12: docker rename: Rename a container
13: docker restart: Restart one or more containers
14: docker rm : Remove one or more containers
15: docker rmi: Remove one or more images
16: docker stats: Display a live stream of container(s) resource usage statistics
17: docker tag: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
18: docker top: Display the running processes of a container
19: docker version: Show the docker version
16: docker port: List port mappings or a specific mapping for the container
15: Docker history: Shows the history of an image
16: docker push: Push a image into the registry
Docker Architecture, Basic Terms and
Commands …. Continued
17: Docker export: Export a container’s filesystem as a tar archive
18: Docker image <subcommand> : Manage images with following commands
● docker image import: Import the contents from a tarball to create a filesystem
image
● docker image inspect: Display detailed information on one or more images
● docker image load: Load an image from a tar archive or STDIN
● docker image ls: List images
● docker image prune: Remove unused images
● docker image pull: Pull an image or a repository from a registry
● docker image push: Push an image or a repository to a registry
● docker image rm: Remove one or more images
About Dockerfile and commands
The Dockerfile is a building block of instruction to build the image, also Dockerfile is a
script, composed of various commands (instructions) and arguments listed
successively to automatically perform actions on a base image in order to create (or
form) a new one. They are used for organizing things and greatly help with
deployments by simplifying the process start-to-finish.
Commands:
ADD, CMD, ENTRYPOINT, ENV, EXPOSE, FROM, MAINTAINER, RUN, USER,
VOLUME, WORKDIR
About Dockerfile and commands
ADD:
The ADD command gets two arguments: a source and a destination. It
basically copies the files from the source on the host into the container's own
filesystem at the set destination. If, however, the source is a URL (e.g.
http://github.com/user/file/), then the contents of the URL are downloaded and placed
at the destination.
Example:
docker ADD [source directory or URL] [destination directory]
About Dockerfile and commands
CMD:
The command CMD, similarly to RUN, can be used for executing a specific
command. However, unlike RUN it is not executed during build, but when a
container is instantiated using the image being built. Therefore, it should be
considered as an initial, default command that gets executed (i.e. run) with the
creation of containers based on the image.
Example:
CMD "echo" "Hello docker!"
About Dockerfile and commands
ENTRYPOINT:
ENTRYPOINT argument sets the concrete default application that is used
every time a container is created using the image. For example, if you have installed
a specific application inside an image and you will use this image to only run that
application, you can state it with ENTRYPOINT and whenever a container is created
from that image, your application will be the target..
Example:
ENTRYPOINT application "argument", "argument", ..
CMD "Hello docker!"
ENTRYPOINT "echo"
About Dockerfile and commands
ENV:
The ENV command is used to set the environment variables (one or more).
These variables consist of “key value” pairs which can be accessed within the
container by scripts and applications alike. This functionality of Docker offers an
enormous amount of flexibility for running programs.
Example:
ENV SERVER_WORKS 4
About Dockerfile and commands
EXPOSE:
The EXPOSE command is used to associate a specified port to enable
networking between the running process inside the container and the outside world
(i.e. the host).
Example:
EXPOSE 8080
About Dockerfile and commands
FROM:
It defines the base image to use to start the build process. It can be any image,
including the ones you have created previously. If a FROM image is not found on the
host, Docker will try to find it (and download) from the Docker Hub or other container
repository. It needs to be the first command declared inside a Dockerfile.
Example:
FROM ubuntu:16.04
About Dockerfile and commands
MAINTAINER:
One of the commands that can be set anywhere in the file - although it would
be better if it was declared on top - is MAINTAINER. This non-executing command
declares the author, hence setting the author field of the images. It should come
nonetheless after FROM.
Example:
MAINTAINER authors_name
About Dockerfile and commands
RUN:
The RUN command is the central executing directive for Dockerfiles. It takes a
command as its argument and runs it to form the image. Unlike CMD, it actually is
used to build the image (forming another layer on top of the previous one which is
committed).
Example:
RUN pip install -r requirements.txt
About Dockerfile and commands
USER:
The USER directive is used to set the UID (or username) which is to run the
container based on the image being built.
Example: USER 751
VOLUME:
The VOLUME command is used to enable access from your container to a
directory on the host machine (i.e. mounting it).
Example: VOLUME ["/my_files"]
About Dockerfile and commands
WORKDIR:
The WORKDIR directive is used to set where the command defined with CMD
is to be executed.
Example: WORKDIR ~/
Difference b/w CMD and ENTRYPOINT
1: You need at least one (ENTRYPOINT or CMD) defined (in order to run)
2: if just one is defined at runtime, CMD and ENTRYPOINT have the same effect
3: For both CMD and ENTRYPOINT, there are "shell" and "exec" versions
4: CMD arguments append to end of ENTRYPOINT sometimes
a: If you use "shell" format for ENTRYPOINT, CMD is ignored.
b: If you use "exec" format for ENTRYPOINT, CMD arguments are appended
after.
5: ENTRYPOINT and CMD can be overridden via command line flags.
Sample Dockerfile
FROM ubuntu:16.04
RUN apt-get update && apt-get -y upgrade
RUN apt install -y libffi-dev python-docutils pkg-config python3-dev python3-pip
RUN rm -r /usr/bin/python
RUN ln -s /usr/bin/python3.5 /usr/bin/python
RUN apt-get install -y python3-dev pkg-config
RUN mkdir /home/docker-demo
#RUN mkdir /var/code
ADD . /home/docker-demo/
WORKDIR /home/docker-demo
RUN pip3 install -r requirements.txt
#RUN ln -s /home/docker-demo /var/code
EXPOSE 8000
ENTRYPOINT ["python", "manage.py"]
CMD ["runserver", "0.0.0.0:8000"]
Build docker file and run docker file
Commands:
docker build --rm -t docker-test .
Run the images:
docker run -d -v
/home/ram/Work/PeopleTicker/docker-demo/first_app/templates/first_app:/home/dec
ker-demo/first_app/templates/first_app -p 8000:8000 --name=demo docker-test
Push an image to dockerhub
Prerequisites:
You need to create an account and a repository in hub.docker.com
Then need to follow below steps.
-> docker login --username=<user-name>
-> docker tag <image-name> <registry-name>
-> docker push <repository-name>
Thank You !!!!

Contenu connexe

Tendances

Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystempsconnolly
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and dockerDuckDuckGo
 
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Edureka!
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...Edureka!
 
Buildservicewithdockerin90mins
Buildservicewithdockerin90minsBuildservicewithdockerin90mins
Buildservicewithdockerin90minsYong Cha
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesYigal Elefant
 
Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)MeetupDataScienceRoma
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to DockerAdrian Otto
 
Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30Khelender Sasan
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basicsWalid Ashraf
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginnersJuneyoung Oh
 

Tendances (19)

Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Buildservicewithdockerin90mins
Buildservicewithdockerin90minsBuildservicewithdockerin90mins
Buildservicewithdockerin90mins
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
 
Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 

Similaire à Docker @ Atlogys

Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Binary Studio
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdfYogeshwaran R
 
Managing Docker containers
Managing Docker containersManaging Docker containers
Managing Docker containerssiuyin
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with dockerMichelle Liu
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanThierry Gayet
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandPRIYADARSHINI ANAND
 
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 2020CloudHero
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basicsSourabh Saxena
 

Similaire à Docker @ Atlogys (20)

Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdf
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Docker
DockerDocker
Docker
 
Managing Docker containers
Managing Docker containersManaging Docker containers
Managing Docker containers
 
Docker introduction - Part 1
Docker introduction - Part 1Docker introduction - Part 1
Docker introduction - Part 1
 
Docker 101
Docker 101Docker 101
Docker 101
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podman
 
docker.pdf
docker.pdfdocker.pdf
docker.pdf
 
Docker
DockerDocker
Docker
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
Docker
DockerDocker
Docker
 
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
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 

Plus de Atlogys Technical Consulting

BDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy SeriesBDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy SeriesAtlogys Technical Consulting
 
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)Atlogys Technical Consulting
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkInfinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkAtlogys Technical Consulting
 
Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!Atlogys Technical Consulting
 

Plus de Atlogys Technical Consulting (20)

Latest UI guidelines for Web Apps
Latest UI guidelines for Web AppsLatest UI guidelines for Web Apps
Latest UI guidelines for Web Apps
 
Discipline at Atlogys
Discipline at AtlogysDiscipline at Atlogys
Discipline at Atlogys
 
Reprogram your mind for Positive Thinking
Reprogram your mind for Positive ThinkingReprogram your mind for Positive Thinking
Reprogram your mind for Positive Thinking
 
Tests for Scalable, Fast, Secure Apps
Tests for Scalable, Fast, Secure AppsTests for Scalable, Fast, Secure Apps
Tests for Scalable, Fast, Secure Apps
 
Atomic Design with PatternLabs
Atomic Design with PatternLabsAtomic Design with PatternLabs
Atomic Design with PatternLabs
 
Git and Version Control at Atlogys
Git and Version Control at AtlogysGit and Version Control at Atlogys
Git and Version Control at Atlogys
 
Guidelines HTML5 & CSS3 - Atlogys (2018)
Guidelines HTML5 & CSS3 - Atlogys (2018)Guidelines HTML5 & CSS3 - Atlogys (2018)
Guidelines HTML5 & CSS3 - Atlogys (2018)
 
Rabbit MQ - Tech Talk at Atlogys
Rabbit MQ - Tech Talk at Atlogys Rabbit MQ - Tech Talk at Atlogys
Rabbit MQ - Tech Talk at Atlogys
 
BDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy SeriesBDD and Test Automation Tech Talk - Atlogys Academy Series
BDD and Test Automation Tech Talk - Atlogys Academy Series
 
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
QA Best Practices at Atlogys - Tech Talk (Atlogys Academy)
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech TalkInfinite Scaling using Lambda and Aws - Atlogys Tech Talk
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
 
How Solr Search Works
How Solr Search WorksHow Solr Search Works
How Solr Search Works
 
Wordpress Tech Talk
Wordpress Tech Talk Wordpress Tech Talk
Wordpress Tech Talk
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
Atlogys Academy - Tech Talk on Mongo DB
Atlogys Academy - Tech Talk on Mongo DBAtlogys Academy - Tech Talk on Mongo DB
Atlogys Academy - Tech Talk on Mongo DB
 
Atlogys Tech Talk - Web 2.0 Design Guidelines
Atlogys Tech Talk - Web 2.0 Design GuidelinesAtlogys Tech Talk - Web 2.0 Design Guidelines
Atlogys Tech Talk - Web 2.0 Design Guidelines
 
Firebase Tech Talk By Atlogys
Firebase Tech Talk By AtlogysFirebase Tech Talk By Atlogys
Firebase Tech Talk By Atlogys
 
Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!Atlogys - Don’t Just Sell Technology, Sell The Experience!
Atlogys - Don’t Just Sell Technology, Sell The Experience!
 
Smart CTO Service
Smart CTO ServiceSmart CTO Service
Smart CTO Service
 
Atlogys Technical Consulting
Atlogys Technical ConsultingAtlogys Technical Consulting
Atlogys Technical Consulting
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Docker @ Atlogys

  • 1. Introduction To Docker Build and Ship Application with Docker By - Ram Awadh Chauhan Senior Software Engineer Atlogys Technical Consulting
  • 2. Today’s Agenda 1: About docker 2: Difference between Virtualization and Containerization. 3: Why Docker? 4: Docker Architecture, basic terms and commands 5: Dockerizing a project with docker (Django App, live Demo, Volume mount Etc) ● Environment variables (ADD, COPY, ENV, EXPOSE, FROM, WORKDIR, ENTRYPOINT, CMD) https://docs.docker.com/engine/reference/builder/#environment-replacement ● Differences b/w CMD and ENTRYPOINT with example ● Create a DockerFile ● Build an Image ● Run the Application ● Volume mount from Host machine to container ● Start, Stop , Delete, Remove commands 7: Who are using it? 8: Q & A sessions.
  • 3. About Docker 1: Docker is a computer program that performs operating-system-level virtualization also known as containerization. 2: Docker firstly started by “Solomon Hykes” in france as internal Project inside dotCloud. 3: It was first released in March 2013 as open source Project. 4: Docker is written in GO language. 5: It was primarily supported only Linux operating system where it used the resource isolation feature of linux kernel. 6: Docker is used to run software packages called "containers". 7: In a typical example use case, one container runs a web server and web application, while a second container runs a database server that is used by the web application. 8: Containers are isolated from each others and use their own set of tools and libraries. 9: Containers can communicate through well-defined channels. 10: All containers use the same kernel and are therefore more lightweight than virtual machines.
  • 4. Difference between Virtualization and Containerization Virtualization Containerization
  • 5. Why Docker? 1: Light weight: Docker container are light weight, only include binaries of the application. 2: Efficient: Minimizes deployment cost and it is very efficient. 3: Fixes Environment based Issue: Removes the environment based issues, like code is working on some environment and not working on some other environments. 4: Very Flexible: Can be ported on any environment by pulling. Copying from one environment to another environment even can be run inside Amazon EC2 and Google Compute Engine instance also on VMS. 5: Isolation: Docker makes sure each container has its own resources that are isolated from other containers.
  • 6. Docker Architecture, Basic Terms and Commands
  • 7. Docker Architecture, Basic Terms and Commands …. Continued Docker Client: This (docker Client) is the primary way by which docker user interact with docker i.e. docker run Docker Registries: Docker registry stores docker images. Docker hub and Docker Cloud are public registries that anyone can use, and Docker is configured to look for images on Docker hub by default. Docker pull <image-name> can be used to pull the images. And Docker push <mage=name > to publish docker images on docker hub. Docker Images: An Image is a read-only template with instructions for creating a Docker container. Docker Container: A Container is a runnable instance of an Image. These can be created, started, stopped or deleted using docker Api or CLI commands.
  • 8. Docker Architecture, Basic Terms and Commands …. Continued List of important commands which can be used by Docker CLI: 1. docker pull: Pull a image from registry 2. Docker build : build and image from dockerfile 3. Docker run: Runs a container 4. docker start: Start one or more stoped container 5. docker stop: Stop one or more running containers 6. docker ps: List containers which are running 7. docker ps -a: List all containers 8. docker kill: Kill one or more running containers 9. docker logs: Fetch the logs of a container 10. docker login: Login into Docker registry like Docker hub 11. docker logout: Logout from the Docker registry
  • 9. Docker Architecture, Basic Terms and Commands …. Continued 12: docker rename: Rename a container 13: docker restart: Restart one or more containers 14: docker rm : Remove one or more containers 15: docker rmi: Remove one or more images 16: docker stats: Display a live stream of container(s) resource usage statistics 17: docker tag: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE 18: docker top: Display the running processes of a container 19: docker version: Show the docker version 16: docker port: List port mappings or a specific mapping for the container 15: Docker history: Shows the history of an image 16: docker push: Push a image into the registry
  • 10. Docker Architecture, Basic Terms and Commands …. Continued 17: Docker export: Export a container’s filesystem as a tar archive 18: Docker image <subcommand> : Manage images with following commands ● docker image import: Import the contents from a tarball to create a filesystem image ● docker image inspect: Display detailed information on one or more images ● docker image load: Load an image from a tar archive or STDIN ● docker image ls: List images ● docker image prune: Remove unused images ● docker image pull: Pull an image or a repository from a registry ● docker image push: Push an image or a repository to a registry ● docker image rm: Remove one or more images
  • 11. About Dockerfile and commands The Dockerfile is a building block of instruction to build the image, also Dockerfile is a script, composed of various commands (instructions) and arguments listed successively to automatically perform actions on a base image in order to create (or form) a new one. They are used for organizing things and greatly help with deployments by simplifying the process start-to-finish. Commands: ADD, CMD, ENTRYPOINT, ENV, EXPOSE, FROM, MAINTAINER, RUN, USER, VOLUME, WORKDIR
  • 12. About Dockerfile and commands ADD: The ADD command gets two arguments: a source and a destination. It basically copies the files from the source on the host into the container's own filesystem at the set destination. If, however, the source is a URL (e.g. http://github.com/user/file/), then the contents of the URL are downloaded and placed at the destination. Example: docker ADD [source directory or URL] [destination directory]
  • 13. About Dockerfile and commands CMD: The command CMD, similarly to RUN, can be used for executing a specific command. However, unlike RUN it is not executed during build, but when a container is instantiated using the image being built. Therefore, it should be considered as an initial, default command that gets executed (i.e. run) with the creation of containers based on the image. Example: CMD "echo" "Hello docker!"
  • 14. About Dockerfile and commands ENTRYPOINT: ENTRYPOINT argument sets the concrete default application that is used every time a container is created using the image. For example, if you have installed a specific application inside an image and you will use this image to only run that application, you can state it with ENTRYPOINT and whenever a container is created from that image, your application will be the target.. Example: ENTRYPOINT application "argument", "argument", .. CMD "Hello docker!" ENTRYPOINT "echo"
  • 15. About Dockerfile and commands ENV: The ENV command is used to set the environment variables (one or more). These variables consist of “key value” pairs which can be accessed within the container by scripts and applications alike. This functionality of Docker offers an enormous amount of flexibility for running programs. Example: ENV SERVER_WORKS 4
  • 16. About Dockerfile and commands EXPOSE: The EXPOSE command is used to associate a specified port to enable networking between the running process inside the container and the outside world (i.e. the host). Example: EXPOSE 8080
  • 17. About Dockerfile and commands FROM: It defines the base image to use to start the build process. It can be any image, including the ones you have created previously. If a FROM image is not found on the host, Docker will try to find it (and download) from the Docker Hub or other container repository. It needs to be the first command declared inside a Dockerfile. Example: FROM ubuntu:16.04
  • 18. About Dockerfile and commands MAINTAINER: One of the commands that can be set anywhere in the file - although it would be better if it was declared on top - is MAINTAINER. This non-executing command declares the author, hence setting the author field of the images. It should come nonetheless after FROM. Example: MAINTAINER authors_name
  • 19. About Dockerfile and commands RUN: The RUN command is the central executing directive for Dockerfiles. It takes a command as its argument and runs it to form the image. Unlike CMD, it actually is used to build the image (forming another layer on top of the previous one which is committed). Example: RUN pip install -r requirements.txt
  • 20. About Dockerfile and commands USER: The USER directive is used to set the UID (or username) which is to run the container based on the image being built. Example: USER 751 VOLUME: The VOLUME command is used to enable access from your container to a directory on the host machine (i.e. mounting it). Example: VOLUME ["/my_files"]
  • 21. About Dockerfile and commands WORKDIR: The WORKDIR directive is used to set where the command defined with CMD is to be executed. Example: WORKDIR ~/
  • 22. Difference b/w CMD and ENTRYPOINT 1: You need at least one (ENTRYPOINT or CMD) defined (in order to run) 2: if just one is defined at runtime, CMD and ENTRYPOINT have the same effect 3: For both CMD and ENTRYPOINT, there are "shell" and "exec" versions 4: CMD arguments append to end of ENTRYPOINT sometimes a: If you use "shell" format for ENTRYPOINT, CMD is ignored. b: If you use "exec" format for ENTRYPOINT, CMD arguments are appended after. 5: ENTRYPOINT and CMD can be overridden via command line flags.
  • 23. Sample Dockerfile FROM ubuntu:16.04 RUN apt-get update && apt-get -y upgrade RUN apt install -y libffi-dev python-docutils pkg-config python3-dev python3-pip RUN rm -r /usr/bin/python RUN ln -s /usr/bin/python3.5 /usr/bin/python RUN apt-get install -y python3-dev pkg-config RUN mkdir /home/docker-demo #RUN mkdir /var/code ADD . /home/docker-demo/ WORKDIR /home/docker-demo RUN pip3 install -r requirements.txt #RUN ln -s /home/docker-demo /var/code EXPOSE 8000 ENTRYPOINT ["python", "manage.py"] CMD ["runserver", "0.0.0.0:8000"]
  • 24. Build docker file and run docker file Commands: docker build --rm -t docker-test . Run the images: docker run -d -v /home/ram/Work/PeopleTicker/docker-demo/first_app/templates/first_app:/home/dec ker-demo/first_app/templates/first_app -p 8000:8000 --name=demo docker-test
  • 25. Push an image to dockerhub Prerequisites: You need to create an account and a repository in hub.docker.com Then need to follow below steps. -> docker login --username=<user-name> -> docker tag <image-name> <registry-name> -> docker push <repository-name>