SlideShare uma empresa Scribd logo
1 de 49
Docker
Saeed Hajizadeh
Index
‱ Pre-Concepts
‱ Concepts
‱ Warm Up
‱ Go To Shell
‱ Let’s Commit
PRE CONCEPTS
Literature
Pre-Concepts
‱ DevOps = “Development” + “Operations”
A set of practices intended to reduce the time
between committing a change to a system and
the change being placed into normal production,
while ensuring high quality
“DevOps: A Software Architect's Perspective.(2015)”
Pre-Concepts
‱ A Sample of DevOps Tool Chain
– Coding development, review, source management
– Building continuous integration tools, build status
– Testing continuous testing tools
– Packaging artifact repository, application pre-deployment
staging
– Releasing change management, release approvals,
release automation
– Configuring infrastructure configuration and
management, infrastructure as code tools
– Monitoring applications performance monitoring, end-
user experience
There are other (similar but different) chains presented for DevOps Tools.
Pre-Concepts
‱ DevOps Automation Tools Sample:
Infrastructure as code
Ansible, Terraform, Puppet, Chef
CI/CD
Jenkins, Shippable, Bamboo, Azure
DevOps
Test automation
Selenium, Cucumber, Apache Jmeter
ChatOps
Hubot, Lita, Cog
Orchestration
Kubernetes, Swarm, Mesos
Deployment
Elastic Beanstalk, Octopus, Vamp
Measurement
NewRelic, Kibana, Datadog,
DynaTrace
Containerization
Docker, Rocket, Unik
Pre-Concepts
‱ Continuous integration (CI)
– The practice of merging all developer working copies to a shared
mainline several times a day
‱ Continuous delivery (CD or CDE)
– A software engineering approach to produce software in short cycles,
ensuring that the software can be reliably released at any time. It
includes building, testing, and releasing software with greater speed
and frequency
‱ Microservice
– A Software Architecture that structures an application as a collection
of loosely coupled services.
CONCEPTS
Docker Literature
Concepts
‱ Containerization
– The use of Linux containers to deploy applications
‱ Flexible
‱ Lightweight
‱ Interchangeable
‱ Portable
‱ Scalable
‱ Stackable
Concepts
‱ Image:
– An executable package that includes everything
needed to run an application--the code, a
runtime, libraries, environment variables, and
configuration files
‱ Container:
– A runtime instance of an image
Concepts
‱ Containers vs. VMs
Concepts
‱ Containers vs. VMs
Concepts
‱ Containers vs. VMs
Docker Architecture
Like Docker Hub
Docker Architecture(x2)
$sudo service docker restart
Restart the docker daemon
A Tree, Just Like a GIT Tree
A Tree, Just Like a GIT Tree
WARM UP
A quick start
Install Docker
Use This link to install Docker on Ubuntu :
https://docs.docker.com/install/linux/docker-ce/ubuntu/
Install Docker
Use This link to install Docker on Ubuntu :
https://docs.docker.com/install/linux/docker-ce/ubuntu/
Easiest Way:
1. Go to https://download.docker.com/linux/ubuntu/dists/, choose your
Ubuntu version, browse to pool/stable/,
choose amd64, armhf, arm64, ppc64el, or s390x, and download
the .deb file for the Docker CE (Community Edition) version you want to
install.
2. Install Docker CE
sudo dpkg -i /path/to/package.deb
Install Docker
Use This link to install Docker on Ubuntu :
https://docs.docker.com/install/linux/docker-ce/ubuntu/
Easiest Way:
1. Go to https://download.docker.com/linux/ubuntu/dists/, choose your
Ubuntu version, browse to pool/stable/,
choose amd64, armhf, arm64, ppc64el, or s390x, and download
the .deb file for the Docker CE (Community Edition) version you want to
install.
2. Install Docker CE
sudo dpkg -i /path/to/package.deb
Docker has 3 types of updates:
Stable latest stable releases.
Test pre-release, not tested.
Nightly latest builds of main line, in progress for the next major release.
Start!
Check you Docker version and Info:
$ docker --version
Docker Version
$ docker info
A Brief of Containers and Images and other stats
Hello World!
You can create and run a container from hello-world image, which is pulled
from Docker Hub.
$ docker run hello-world
Read the output! It is important!
Hello World!
You can create and run a container from hello-world image, which is pulled
from Docker Hub.
$ docker run hello-world
Read the output! It is important!
GO TO SHELL
It’s time to
Docker Command Starter Pack
Get Lists
Docker ps
Get list of running containers
-a Show all containers (stopped or running)
-q Only numeric IDs.
--format Format the output. Samples:
--format "{{.ID}}: {{.Command}}"
--format "table {{.ID}}t{{.Labels}}"
Docker images
Get list of images [on your local machine]
docker build --tag=myImage:v0.0.1 ./
Build a new image with name=“myImage” and tag=“v0.0.1” from
current directory.
There should be a `DockerFile` in current directory which defines the
new image.
Build An Image
docker build --tag=myImage:v0.0.1 ./
Build a new image with name=“myImage” and tag=“v0.0.1” from
current directory.
There should be a `DockerFile` in current directory which defines the
new image.
Build An Image# Use an official Python runtime as a parent image
FROM python:2.7-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 80
# Define environment variable
ENV NAME World
# Set proxy server
ENV http_proxy host:port
ENV https_proxy host:port
# Run app.py when the container launches
CMD ["python", "app.py"]
DockerFile
docker run -d -p 4000:80 --name myContainer myImage
Build and star a new container from “myImage”.
-p 4000:80 Publish port 80 on container and connect it to port 4000 on localhost.
-d Start the container on detached mode.
--name myContainer Set the container name to “myContainer”
Run The App
localhost
myContainerherContainertheirContainer
4000
80
docker run -d -p 4000:80 --name myContainer myImage
Build and star a new container from “myImage”.
-p 4000:80 Publish port 80 on container and connect it to port 4000 on localhost.
-d Start the container on detached mode.
--name myContainer Set the container name to “myContainer”
Run The App
localhost
myContainerherContainertheirContainer
4000
80
You can use `docker create` just like docker run. The difference is that `docker
create` won’t start the container after creating it, but `docker run` will.
CMD and Args: Put your CMD and Args after the image name
docker run -d myImage /app/run.sh -c
EXPOSE: Expose ports, additional to those exposed by image defaults.
docker run -d --expose 81 --expose 82 myImage
LINK: Link this container to other containers.
docker run -d --link herContainer --link theirContainer myImage
Run The App-
Overriding Image Defaults
MOUNT vs. VOLUME: Mount the [src] file/directory on host machine to [dst]
file/directory on container.
--mount type=bind,source=[src],target=[dst],[readonly]
-v [src]:[dst]
Difference in behavior?
While bind-mount a file or directory that does not yet exist on the host machine:
Using -v : It is always created as a directory.
Using –mount: Docker does not create it, but generates an error
Run The App-
Mount and Volume
$docker inspect myContainer
It will inspect the container!
The output is a json object which shows the configuration of the container
Inspect What You Ran
$docker inspect myContainer
It will inspect the container!
The output is a json object which shows the configuration of the container
Inspect What You Ran
$docker inspect myContainer
It will inspect the container!
The output is a json object which shows the configuration of the container
Inspect What You Ran
You may format the output using --format
Address the part you need in inspect json output.
And set the result to be in json format:
docker stop myContainer
docker start myContainer
docker restart myContainer
Annnnnd 
 Manage yourContainer
docker stop myContainer
docker start myContainer
docker restart myContainer
Annnnnd 
 Manage yourContainer
But let me say
docker ps only shows running container.
Use docker ps -a to get all containers.
docker stop will send The main process inside
the container a SIGTERM, and after a grace
period, SIGKILL.
Use docker kill to send other signals.
$docker exec -it myContainer bash
It will execute “bash” on “myContainer”.
-it means -i -t 
-i keep the STDIN (interactive)
-t Allocate a pseudo Terminal (Ctrl+C will work!)
You may execute any application on the container instead of “bash” and
also send arguments. As an example:
$docker exec -it myContainer mysql -uroot myDb
“Drink Me”
$docker exec -it myContainer bash
It will execute “bash” on “myContainer”.
-it means -i -t 
-i keep the STDIN (interactive)
-t Allocate a pseudo Terminal (Ctrl+C will work!)
You may execute any application on the container instead of “bash” and
also send arguments. As an example:
$docker exec -it myContainer mysql -uroot myDb
“Drink Me”
“Eat Me”
Use Ctrl+P Ctrl+Q to go out of container
instead of exit.
Main Process, how are you?
docker logs [OPTIONS] myContainer
Show the logs of your main process on container.
OPTIONS:
--tail Number of lines to show (from the end) --tail 100
-t Show timestamp of each log entry (each line)
-f Follow the log
--since Show logs since a defined time --since 2013-01-02T13:23:37
--until Show logs until a defined time --until 42m
You may use a direct time or relative time for both since and until
p.b.u.h
docker rm 7ac899b82637
Remove the container with id of 7ac899b82637
You may use --force to force!
Tip of today: Use this command to remove all stopped containers.
$docker rm $(docker ps -a -q)
Tip of tomorrow: Use --link to remove a link between 2 containers.
$docker rm --link /webapp/redis

and its image.
docker rmi myImage
Remove the image “myImage”.
You may use --force to force!
Try not to use this.
LET’S COMMIT
You told me it’s like a got, so
Pull
docker pull theirImage:v2
Pull “theirImage:v2” from docker registry.
It will pull “latest” if you do not mention the tag.
You also may use digest to pull a specific build, not the last updated one.
docker pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2
Or use another registry than dockerhub:
docker pull myregistry.local:5000/testing/test-image
Commit
docker commit myContainer myImage:v2
Commit “myContainer” to a new image: “myImage” with tag “v2”
--change for running Dockerfile Commands before committing.
$ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a
[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
$ docker commit --change "ENV DEBUG true" c3f279d17e0a svendowideit/testimage:version3
f5283438590d
$ docker inspect -f "{{ .Config.Env }}" f5283438590d
[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true]
Push
docker push registry-host:5000/myImage
Push “registry-host:5000/myImage” to my local docker registry.
Use “tag” before to tag your image in a right way:
docker tag myImage registry-host:5000/myImage
Decide On Base Image For Java

Mais conteĂșdo relacionado

Mais procurados

Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°
Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°
Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°raccoony
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
íŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker Compose
íŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker ComposeíŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker Compose
íŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker Composeraccoony
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Carlos Sanchez
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011Carlos Sanchez
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)Soshi Nemoto
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011Carlos Sanchez
 
Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Toby Griffiths
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05dotCloud
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013Tomas Doran
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90minsLarry Cai
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Nicolas Poggi
 

Mais procurados (19)

Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Docker
DockerDocker
Docker
 
Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°
Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°
Django로 만든 ì›č ì• í”ŒëŠŹìŒ€ìŽì…˜ 도컀띌읎징하Ʞ + 도컀 ì»ŽíŹìŠˆëĄœ 개발 환êČœ ê”Źì¶•í•˜êž°
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
íŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker Compose
íŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker ComposeíŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker Compose
íŒŒìŽìŹ 개발환êČœ ê”Źì„±í•˜êž°ì˜ 끝판왕 - Docker Compose
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
 
Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
 

Semelhante a Docker Starter Pack

Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Will Hall
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for DevelopersJasonStraughan1
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windowsDocker, Inc.
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET DevelopersTaswar Bhatti
 
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 Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...Puppet
 
Docker intro
Docker introDocker intro
Docker introFrei Zhang
 
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 module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerGuido Schmutz
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) serverDmitry Lyfar
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioJĂ©rĂŽme Petazzoni
 
[Codelab 2017] Docker Ʞ쎈 및 활용 방안
[Codelab 2017] Docker Ʞ쎈 및 활용 방안[Codelab 2017] Docker Ʞ쎈 및 활용 방안
[Codelab 2017] Docker Ʞ쎈 및 활용 ë°©ì•ˆì–‘ìžŹë™ 윔드랩
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
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
 
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
 

Semelhante a Docker Starter Pack (20)

Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
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 Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
 
Docker intro
Docker introDocker intro
Docker intro
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
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 module 1
Docker module 1Docker module 1
Docker module 1
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Omaha (Google Update) server
Omaha (Google Update) serverOmaha (Google Update) server
Omaha (Google Update) server
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
[Codelab 2017] Docker Ʞ쎈 및 활용 방안
[Codelab 2017] Docker Ʞ쎈 및 활용 방안[Codelab 2017] Docker Ʞ쎈 및 활용 방안
[Codelab 2017] Docker Ʞ쎈 및 활용 방안
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
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...
 
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
 

Último

%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
 
%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
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+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 Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
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
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžDelhi Call girls
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžDelhi Call girls
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%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
 

Último (20)

%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
 
%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
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+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 Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
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
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%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
 

Docker Starter Pack

  • 2. Index ‱ Pre-Concepts ‱ Concepts ‱ Warm Up ‱ Go To Shell ‱ Let’s Commit
  • 4. Pre-Concepts ‱ DevOps = “Development” + “Operations” A set of practices intended to reduce the time between committing a change to a system and the change being placed into normal production, while ensuring high quality “DevOps: A Software Architect's Perspective.(2015)”
  • 5. Pre-Concepts ‱ A Sample of DevOps Tool Chain – Coding development, review, source management – Building continuous integration tools, build status – Testing continuous testing tools – Packaging artifact repository, application pre-deployment staging – Releasing change management, release approvals, release automation – Configuring infrastructure configuration and management, infrastructure as code tools – Monitoring applications performance monitoring, end- user experience There are other (similar but different) chains presented for DevOps Tools.
  • 6. Pre-Concepts ‱ DevOps Automation Tools Sample: Infrastructure as code Ansible, Terraform, Puppet, Chef CI/CD Jenkins, Shippable, Bamboo, Azure DevOps Test automation Selenium, Cucumber, Apache Jmeter ChatOps Hubot, Lita, Cog Orchestration Kubernetes, Swarm, Mesos Deployment Elastic Beanstalk, Octopus, Vamp Measurement NewRelic, Kibana, Datadog, DynaTrace Containerization Docker, Rocket, Unik
  • 7. Pre-Concepts ‱ Continuous integration (CI) – The practice of merging all developer working copies to a shared mainline several times a day ‱ Continuous delivery (CD or CDE) – A software engineering approach to produce software in short cycles, ensuring that the software can be reliably released at any time. It includes building, testing, and releasing software with greater speed and frequency ‱ Microservice – A Software Architecture that structures an application as a collection of loosely coupled services.
  • 9. Concepts ‱ Containerization – The use of Linux containers to deploy applications ‱ Flexible ‱ Lightweight ‱ Interchangeable ‱ Portable ‱ Scalable ‱ Stackable
  • 10. Concepts ‱ Image: – An executable package that includes everything needed to run an application--the code, a runtime, libraries, environment variables, and configuration files ‱ Container: – A runtime instance of an image
  • 15. Docker Architecture(x2) $sudo service docker restart Restart the docker daemon
  • 16. A Tree, Just Like a GIT Tree
  • 17. A Tree, Just Like a GIT Tree
  • 19. Install Docker Use This link to install Docker on Ubuntu : https://docs.docker.com/install/linux/docker-ce/ubuntu/
  • 20. Install Docker Use This link to install Docker on Ubuntu : https://docs.docker.com/install/linux/docker-ce/ubuntu/ Easiest Way: 1. Go to https://download.docker.com/linux/ubuntu/dists/, choose your Ubuntu version, browse to pool/stable/, choose amd64, armhf, arm64, ppc64el, or s390x, and download the .deb file for the Docker CE (Community Edition) version you want to install. 2. Install Docker CE sudo dpkg -i /path/to/package.deb
  • 21. Install Docker Use This link to install Docker on Ubuntu : https://docs.docker.com/install/linux/docker-ce/ubuntu/ Easiest Way: 1. Go to https://download.docker.com/linux/ubuntu/dists/, choose your Ubuntu version, browse to pool/stable/, choose amd64, armhf, arm64, ppc64el, or s390x, and download the .deb file for the Docker CE (Community Edition) version you want to install. 2. Install Docker CE sudo dpkg -i /path/to/package.deb Docker has 3 types of updates: Stable latest stable releases. Test pre-release, not tested. Nightly latest builds of main line, in progress for the next major release.
  • 22. Start! Check you Docker version and Info: $ docker --version Docker Version $ docker info A Brief of Containers and Images and other stats
  • 23. Hello World! You can create and run a container from hello-world image, which is pulled from Docker Hub. $ docker run hello-world Read the output! It is important!
  • 24. Hello World! You can create and run a container from hello-world image, which is pulled from Docker Hub. $ docker run hello-world Read the output! It is important!
  • 27. Get Lists Docker ps Get list of running containers -a Show all containers (stopped or running) -q Only numeric IDs. --format Format the output. Samples: --format "{{.ID}}: {{.Command}}" --format "table {{.ID}}t{{.Labels}}" Docker images Get list of images [on your local machine]
  • 28. docker build --tag=myImage:v0.0.1 ./ Build a new image with name=“myImage” and tag=“v0.0.1” from current directory. There should be a `DockerFile` in current directory which defines the new image. Build An Image
  • 29. docker build --tag=myImage:v0.0.1 ./ Build a new image with name=“myImage” and tag=“v0.0.1” from current directory. There should be a `DockerFile` in current directory which defines the new image. Build An Image# Use an official Python runtime as a parent image FROM python:2.7-slim # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app # Install any needed packages specified in requirements.txt RUN pip install --trusted-host pypi.python.org -r requirements.txt # Make port 80 available to the world outside this container EXPOSE 80 # Define environment variable ENV NAME World # Set proxy server ENV http_proxy host:port ENV https_proxy host:port # Run app.py when the container launches CMD ["python", "app.py"] DockerFile
  • 30. docker run -d -p 4000:80 --name myContainer myImage Build and star a new container from “myImage”. -p 4000:80 Publish port 80 on container and connect it to port 4000 on localhost. -d Start the container on detached mode. --name myContainer Set the container name to “myContainer” Run The App localhost myContainerherContainertheirContainer 4000 80
  • 31. docker run -d -p 4000:80 --name myContainer myImage Build and star a new container from “myImage”. -p 4000:80 Publish port 80 on container and connect it to port 4000 on localhost. -d Start the container on detached mode. --name myContainer Set the container name to “myContainer” Run The App localhost myContainerherContainertheirContainer 4000 80 You can use `docker create` just like docker run. The difference is that `docker create` won’t start the container after creating it, but `docker run` will.
  • 32. CMD and Args: Put your CMD and Args after the image name docker run -d myImage /app/run.sh -c EXPOSE: Expose ports, additional to those exposed by image defaults. docker run -d --expose 81 --expose 82 myImage LINK: Link this container to other containers. docker run -d --link herContainer --link theirContainer myImage Run The App- Overriding Image Defaults
  • 33. MOUNT vs. VOLUME: Mount the [src] file/directory on host machine to [dst] file/directory on container. --mount type=bind,source=[src],target=[dst],[readonly] -v [src]:[dst] Difference in behavior? While bind-mount a file or directory that does not yet exist on the host machine: Using -v : It is always created as a directory. Using –mount: Docker does not create it, but generates an error Run The App- Mount and Volume
  • 34. $docker inspect myContainer It will inspect the container! The output is a json object which shows the configuration of the container Inspect What You Ran
  • 35. $docker inspect myContainer It will inspect the container! The output is a json object which shows the configuration of the container Inspect What You Ran
  • 36. $docker inspect myContainer It will inspect the container! The output is a json object which shows the configuration of the container Inspect What You Ran You may format the output using --format Address the part you need in inspect json output. And set the result to be in json format:
  • 37.
  • 38. docker stop myContainer docker start myContainer docker restart myContainer Annnnnd 
 Manage yourContainer
  • 39. docker stop myContainer docker start myContainer docker restart myContainer Annnnnd 
 Manage yourContainer But let me say docker ps only shows running container. Use docker ps -a to get all containers. docker stop will send The main process inside the container a SIGTERM, and after a grace period, SIGKILL. Use docker kill to send other signals.
  • 40. $docker exec -it myContainer bash It will execute “bash” on “myContainer”. -it means -i -t  -i keep the STDIN (interactive) -t Allocate a pseudo Terminal (Ctrl+C will work!) You may execute any application on the container instead of “bash” and also send arguments. As an example: $docker exec -it myContainer mysql -uroot myDb “Drink Me”
  • 41. $docker exec -it myContainer bash It will execute “bash” on “myContainer”. -it means -i -t  -i keep the STDIN (interactive) -t Allocate a pseudo Terminal (Ctrl+C will work!) You may execute any application on the container instead of “bash” and also send arguments. As an example: $docker exec -it myContainer mysql -uroot myDb “Drink Me” “Eat Me” Use Ctrl+P Ctrl+Q to go out of container instead of exit.
  • 42. Main Process, how are you? docker logs [OPTIONS] myContainer Show the logs of your main process on container. OPTIONS: --tail Number of lines to show (from the end) --tail 100 -t Show timestamp of each log entry (each line) -f Follow the log --since Show logs since a defined time --since 2013-01-02T13:23:37 --until Show logs until a defined time --until 42m You may use a direct time or relative time for both since and until
  • 43. p.b.u.h docker rm 7ac899b82637 Remove the container with id of 7ac899b82637 You may use --force to force! Tip of today: Use this command to remove all stopped containers. $docker rm $(docker ps -a -q) Tip of tomorrow: Use --link to remove a link between 2 containers. $docker rm --link /webapp/redis
  • 44. 
and its image. docker rmi myImage Remove the image “myImage”. You may use --force to force! Try not to use this.
  • 45. LET’S COMMIT You told me it’s like a got, so
  • 46. Pull docker pull theirImage:v2 Pull “theirImage:v2” from docker registry. It will pull “latest” if you do not mention the tag. You also may use digest to pull a specific build, not the last updated one. docker pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 Or use another registry than dockerhub: docker pull myregistry.local:5000/testing/test-image
  • 47. Commit docker commit myContainer myImage:v2 Commit “myContainer” to a new image: “myImage” with tag “v2” --change for running Dockerfile Commands before committing. $ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] $ docker commit --change "ENV DEBUG true" c3f279d17e0a svendowideit/testimage:version3 f5283438590d $ docker inspect -f "{{ .Config.Env }}" f5283438590d [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true]
  • 48. Push docker push registry-host:5000/myImage Push “registry-host:5000/myImage” to my local docker registry. Use “tag” before to tag your image in a right way: docker tag myImage registry-host:5000/myImage
  • 49. Decide On Base Image For Java