SlideShare a Scribd company logo
Containerization Basics
AcademyPRO
Today’s
agenda
● Vocabulary
● Run static website
● Build & Run own image
● Logs
Vocabulary: Images
Images - The file system and configuration of our application which are used to
create containers.
Vocabulary: Containers
Containers - Running instances of Docker images — containers run the actual
applications.
A container includes an application and all of its dependencies. It shares the
kernel with other containers, and runs as an isolated process in user space on
the host OS.
A list of running containers can be seen using the docker ps command.
Vocabulary: Daemon & Client
Docker daemon - The background service running on the host that manages
building, running and distributing Docker containers.
Docker client - The command line tool that allows the user to interact with the
Docker daemon.
Vocabulary: Hub
Docker Hub - A registry of Docker images. You can think of the registry as a
directory of all available Docker images.
Run a static website in a container
docker run nginx
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
585e0876dad1 nginx "nginx -g 'daemon ..." About a minute ago Up About a minute 80/tcp, 443/tcp goofy_payne
docker stop 585e0876dad1
docker rm 585e0876dad1
Run a static website in a container
(Successful)
docker run -d -P nginx
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
585e0876dad1 nginx "nginx -g 'daemon ..." About a minute ago Up About a minute 0.0.0.0:32769->80/tcp, goofy_payne
0.0.0.0:32768->443/tcp
docker port goofy_payne
443/tcp -> 0.0.0.0:32768
80/tcp -> 0.0.0.0:32769
Run a static website in a container
(Successful) Attempt #2
docker run --name static-site -d -p 8888:80 nginx
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0f21f39e4cfa nginx "nginx -g 'daemon ..." About a minute ago Up About a minute 0.0.0.0:8888->80/tcp, static-site
443/tcp
docker rm -f static-site
Docker Images
To see the list of images that are available locally on your system, run the
docker images command.
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 00f017a8c2a6 2 months ago 1.11 MB
hello-world latest 48b5124b2768 3 months ago 1.84 kB
nginx latest 4a88d06e26f4 7 months ago 184 MB
Also you could pull a specific version of image as follows:
docker pull node:0.10
Docker search
To get a new Docker image you can either get it from a registry (such as the
Docker Hub) or create your own. There are hundreds of thousands of images
available on Docker hub. You can also search for images directly from the
command line using docker search.
Base & Child Images
An important distinction with regard to images is between base images and
child images.
● Base images are images that have no parent images, usually images with
an OS like ubuntu, alpine or debian.
● Child images are images that build on base images and add additional
functionality.
Official & User Images
Official
Another key concept is the idea of official images and user images. (Both of
which can be base images or child images.)
● Official images are Docker sanctioned images. Docker, Inc. sponsors a
dedicated team that is responsible for reviewing and publishing all Official
Repositories content. This team works in collaboration with upstream
software maintainers, security experts, and the broader Docker
community. These are not prefixed by an organization or username. In the
list of images above, the python, node, alpine and nginx images are official
(base) images.
Official & User Images
User
● User images are images created and shared by users like you. They build
on base images and add additional functionality. Typically these are
formatted as user/image-name. The user value in the image name is your
Docker Hub user or organization name.
Dockerfile commands summary
FROM
FROM starts the Dockerfile. It is a requirement that the Dockerfile must start
with the FROM command. Images are created in layers, which means you can
use another image as the base image for your own. The FROM command
defines your base layer. As arguments, it takes the name of the image.
Optionally, you can add the Docker Hub username of the maintainer and image
version, in the format username/imagename:version.
Dockerfile commands summary
RUN
RUN is used to build up the Image you're creating. For each RUN command,
Docker will run the command then create a new layer of the image. This way
you can roll back your image to previous states easily. The syntax for a RUN
instruction is to place the full text of the shell command after the RUN (e.g., RUN
mkdir /user/local/foo). This will automatically run in a /bin/sh shell.
You can define a different shell like this: RUN /bin/bash -c 'mkdir
/user/local/foo'
Dockerfile commands summary
COPY & CMD
COPY copies local files into the container.
CMD defines the commands that will run on the Image at start-up. Unlike a RUN,
this does not create a new layer for the Image, but simply runs the command.
There can only be one CMD per a Dockerfile/Image. If you need to run multiple
commands, the best way to do that is to have the CMD run a script. CMD
requires that you tell it where to run the command, unlike RUN. So example CMD
commands would be:
CMD ["python", "./app.py"]
CMD ["/bin/bash", "echo", "Hello World"]
Dockerfile commands summary
Expose & Push
EXPOSE opens ports in your image to allow communication to the outside
world when it runs in a container.
PUSH pushes your image to Docker Hub, or alternately to a private registry
Build image
docker build -t oleksandrkovalov/node_example .
docker run -d -p 8080:3000 oleksandrkovalov/node_example
Push image
docker login
docker push oleksandrkovalov/node_example
The push refers to a repository [docker.io/oleksandrkovalov/node_example]
a6cc0f5939b9: Pushed
...
5d6cbe0dbcf9: Pushed
latest: digest: sha256:239f102592ae13843da87bd61225fe40c686e869ff747f6e613dde8806c99009 size: 2837
Container logging
● Container PID 1 process output can be viewed with docker logs command
● Will show whatever PID 1 writes to stdout
View the output of the containers PID 1 process
docker logs <container name>
View and follow the output
docker logs -f <container name>
Container application logs
● Typically, apps have a well defined log location
● Map a host folder to the application’s log folder in the container
● In this way you can view the log generated in the container from your host
folder
Run a container using nginx image and mount a volume to map the
/tmp/nginxlogs folder in the host to the /var/log/nginx folder in the
container
docker run -d -P -v /tmp/nginxlogs:/var/log/nginx nginx
Private registry
● Allows you to run own registry instead of using Docker Hub
● Multiple options
○ Run registry server using container
○ Docker Hub Enterprise
● Two versions
○ Registry 1.0 for Docker 1.5 and below
○ Registry 2.0 for Docker 1.6
Setting up private registry
● Run a registry inside a container
● Use the registry image at http://registry.hub.docker.com/u/library/registry
● Image contains pre-configured registry v2.0
Run registry:
docker run -d -p 5000:5000 registry
Push and pull from private registry
● First tag image with host IP or domain of registry server, then run docker
push
Tag image and specify the registry host:
docker tag <image id> localhost:5000/my-app:1.0
Push image to registry:
docker push localhost:5000/my-app:1.0
Pull image from registry:
docker pull localhost:5000/my-app:1.0
Any questions?
The end
for today :)
Ad

More Related Content

What's hot (20)

Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
Open Source Consulting
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
Mathieu Buffenoir
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
Ramon Morales
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
Justin Crown
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
Giovanni Toraldo
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
Docker Presentation
Docker PresentationDocker Presentation
Docker Presentation
Adhoura Academy
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
Justyna Ilczuk
 
Docker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmDocker Compose to Production with Docker Swarm
Docker Compose to Production with Docker Swarm
Mario IC
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaWhen Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
Giovanni Toraldo
 
Docker Swarm & Machine
Docker Swarm & MachineDocker Swarm & Machine
Docker Swarm & Machine
Eueung Mulyana
 
Docker Distributed application bundle & Stack - Overview
Docker Distributed application bundle & Stack - Overview Docker Distributed application bundle & Stack - Overview
Docker Distributed application bundle & Stack - Overview
Thomas Chacko
 
Docker / Ansible
Docker / AnsibleDocker / Ansible
Docker / Ansible
Stephane Manciot
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
LinkMe Srl
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
Adrian Otto
 
Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
Sathish VJ
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
Evans Ye
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
DuckDuckGo
 
Docker compose
Docker composeDocker compose
Docker compose
Felipe Ruhland
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
Massimiliano Dessì
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
Ramon Morales
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
Justin Crown
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
Justyna Ilczuk
 
Docker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmDocker Compose to Production with Docker Swarm
Docker Compose to Production with Docker Swarm
Mario IC
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaWhen Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
Giovanni Toraldo
 
Docker Swarm & Machine
Docker Swarm & MachineDocker Swarm & Machine
Docker Swarm & Machine
Eueung Mulyana
 
Docker Distributed application bundle & Stack - Overview
Docker Distributed application bundle & Stack - Overview Docker Distributed application bundle & Stack - Overview
Docker Distributed application bundle & Stack - Overview
Thomas Chacko
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
LinkMe Srl
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
Adrian Otto
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
Evans Ye
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
DuckDuckGo
 

Viewers also liked (9)

Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
Jesus Guzman
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Frank Munz
 
Oracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsOracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic Functions
Zohar Elkayam
 
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Jérôme Petazzoni
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Bruno Borges
 
Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
Binary Studio
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Alphorm.com Formation Docker (2/2) - Administration Avancée
Alphorm.com Formation Docker (2/2) - Administration Avancée Alphorm.com Formation Docker (2/2) - Administration Avancée
Alphorm.com Formation Docker (2/2) - Administration Avancée
Alphorm
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
Jesus Guzman
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Frank Munz
 
Oracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsOracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic Functions
Zohar Elkayam
 
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Jérôme Petazzoni
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Bruno Borges
 
Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
Binary Studio
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Alphorm.com Formation Docker (2/2) - Administration Avancée
Alphorm.com Formation Docker (2/2) - Administration Avancée Alphorm.com Formation Docker (2/2) - Administration Avancée
Alphorm.com Formation Docker (2/2) - Administration Avancée
Alphorm
 
Ad

Similar to Academy PRO: Docker. Part 2 (20)

Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
Binary Studio
 
Lecture eight to be introduced in class.
Lecture eight to be introduced in class.Lecture eight to be introduced in class.
Lecture eight to be introduced in class.
nigamsajal14
 
docker.pdf
docker.pdfdocker.pdf
docker.pdf
EishaTirRaazia1
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
Atlogys Technical Consulting
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker
DockerDocker
Docker
Hussien Elhannan
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
UsamaMushtaq24
 
Docker
DockerDocker
Docker
Abhishek Tomar
 
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
Guido Schmutz
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
Thomas Tong, FRM, PMP
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
 
How to _docker
How to _dockerHow to _docker
How to _docker
Abdur Rab Marjan
 
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
 
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
Alessandro Mignogna
 
Setting Up Harbor Docker Registry in ubuntu
Setting Up Harbor Docker Registry in ubuntuSetting Up Harbor Docker Registry in ubuntu
Setting Up Harbor Docker Registry in ubuntu
Thiyagarajan saminadane
 
Master Docker - first meetup
Master Docker - first meetupMaster Docker - first meetup
Master Docker - first meetup
Ayoub Benaissa
 
Docker
DockerDocker
Docker
Mutlu Okuducu
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Getting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOpsGetting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOps
demoNguyen
 
Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
Binary Studio
 
Lecture eight to be introduced in class.
Lecture eight to be introduced in class.Lecture eight to be introduced in class.
Lecture eight to be introduced in class.
nigamsajal14
 
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
Guido Schmutz
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
 
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
 
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
Alessandro Mignogna
 
Setting Up Harbor Docker Registry in ubuntu
Setting Up Harbor Docker Registry in ubuntuSetting Up Harbor Docker Registry in ubuntu
Setting Up Harbor Docker Registry in ubuntu
Thiyagarajan saminadane
 
Master Docker - first meetup
Master Docker - first meetupMaster Docker - first meetup
Master Docker - first meetup
Ayoub Benaissa
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Getting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOpsGetting Started With Docker: Simplifying DevOps
Getting Started With Docker: Simplifying DevOps
demoNguyen
 
Ad

More from Binary Studio (20)

Academy PRO: D3, part 1
Academy PRO: D3, part 1Academy PRO: D3, part 1
Academy PRO: D3, part 1
Binary Studio
 
Academy PRO: Cryptography 3
Academy PRO: Cryptography 3Academy PRO: Cryptography 3
Academy PRO: Cryptography 3
Binary Studio
 
Academy PRO: Cryptography 1
Academy PRO: Cryptography 1Academy PRO: Cryptography 1
Academy PRO: Cryptography 1
Binary Studio
 
Academy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobXAcademy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobX
Binary Studio
 
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - OrderlyBinary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio
 
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - UnicornBinary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio
 
Academy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneousAcademy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneous
Binary Studio
 
Academy PRO: React native - publish
Academy PRO: React native - publishAcademy PRO: React native - publish
Academy PRO: React native - publish
Binary Studio
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
Binary Studio
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
Binary Studio
 
Academy PRO: React Native - introduction
Academy PRO: React Native - introductionAcademy PRO: React Native - introduction
Academy PRO: React Native - introduction
Binary Studio
 
Academy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis BeketskyAcademy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis Beketsky
Binary Studio
 
Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1
Binary Studio
 
Academy PRO: Node.js - miscellaneous. Lecture 5
Academy PRO: Node.js - miscellaneous. Lecture 5Academy PRO: Node.js - miscellaneous. Lecture 5
Academy PRO: Node.js - miscellaneous. Lecture 5
Binary Studio
 
Academy PRO: Node.js in production. lecture 4
Academy PRO: Node.js in production. lecture 4Academy PRO: Node.js in production. lecture 4
Academy PRO: Node.js in production. lecture 4
Binary Studio
 
Academy PRO: Node.js alternative stacks. Lecture 3
Academy PRO: Node.js alternative stacks. Lecture 3Academy PRO: Node.js alternative stacks. Lecture 3
Academy PRO: Node.js alternative stacks. Lecture 3
Binary Studio
 
Academy PRO: Node.js default stack. Lecture 2
Academy PRO: Node.js default stack. Lecture 2Academy PRO: Node.js default stack. Lecture 2
Academy PRO: Node.js default stack. Lecture 2
Binary Studio
 
Academy PRO: Node.js platform. Lecture 1
Academy PRO: Node.js platform. Lecture 1  Academy PRO: Node.js platform. Lecture 1
Academy PRO: Node.js platform. Lecture 1
Binary Studio
 
SubmitJS: Developing desktop applications with Electron. Mykyta Semenistyi
SubmitJS: Developing desktop applications with Electron. Mykyta SemenistyiSubmitJS: Developing desktop applications with Electron. Mykyta Semenistyi
SubmitJS: Developing desktop applications with Electron. Mykyta Semenistyi
Binary Studio
 
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
SubmitJS: Is react + redux + typescript a good combination? Dmytro BesedaSubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
Binary Studio
 
Academy PRO: D3, part 1
Academy PRO: D3, part 1Academy PRO: D3, part 1
Academy PRO: D3, part 1
Binary Studio
 
Academy PRO: Cryptography 3
Academy PRO: Cryptography 3Academy PRO: Cryptography 3
Academy PRO: Cryptography 3
Binary Studio
 
Academy PRO: Cryptography 1
Academy PRO: Cryptography 1Academy PRO: Cryptography 1
Academy PRO: Cryptography 1
Binary Studio
 
Academy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobXAcademy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobX
Binary Studio
 
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - OrderlyBinary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio
 
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - UnicornBinary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio
 
Academy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneousAcademy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneous
Binary Studio
 
Academy PRO: React native - publish
Academy PRO: React native - publishAcademy PRO: React native - publish
Academy PRO: React native - publish
Binary Studio
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
Binary Studio
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
Binary Studio
 
Academy PRO: React Native - introduction
Academy PRO: React Native - introductionAcademy PRO: React Native - introduction
Academy PRO: React Native - introduction
Binary Studio
 
Academy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis BeketskyAcademy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis Beketsky
Binary Studio
 
Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1
Binary Studio
 
Academy PRO: Node.js - miscellaneous. Lecture 5
Academy PRO: Node.js - miscellaneous. Lecture 5Academy PRO: Node.js - miscellaneous. Lecture 5
Academy PRO: Node.js - miscellaneous. Lecture 5
Binary Studio
 
Academy PRO: Node.js in production. lecture 4
Academy PRO: Node.js in production. lecture 4Academy PRO: Node.js in production. lecture 4
Academy PRO: Node.js in production. lecture 4
Binary Studio
 
Academy PRO: Node.js alternative stacks. Lecture 3
Academy PRO: Node.js alternative stacks. Lecture 3Academy PRO: Node.js alternative stacks. Lecture 3
Academy PRO: Node.js alternative stacks. Lecture 3
Binary Studio
 
Academy PRO: Node.js default stack. Lecture 2
Academy PRO: Node.js default stack. Lecture 2Academy PRO: Node.js default stack. Lecture 2
Academy PRO: Node.js default stack. Lecture 2
Binary Studio
 
Academy PRO: Node.js platform. Lecture 1
Academy PRO: Node.js platform. Lecture 1  Academy PRO: Node.js platform. Lecture 1
Academy PRO: Node.js platform. Lecture 1
Binary Studio
 
SubmitJS: Developing desktop applications with Electron. Mykyta Semenistyi
SubmitJS: Developing desktop applications with Electron. Mykyta SemenistyiSubmitJS: Developing desktop applications with Electron. Mykyta Semenistyi
SubmitJS: Developing desktop applications with Electron. Mykyta Semenistyi
Binary Studio
 
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
SubmitJS: Is react + redux + typescript a good combination? Dmytro BesedaSubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
Binary Studio
 

Recently uploaded (20)

SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 

Academy PRO: Docker. Part 2

  • 2. Today’s agenda ● Vocabulary ● Run static website ● Build & Run own image ● Logs
  • 3. Vocabulary: Images Images - The file system and configuration of our application which are used to create containers.
  • 4. Vocabulary: Containers Containers - Running instances of Docker images — containers run the actual applications. A container includes an application and all of its dependencies. It shares the kernel with other containers, and runs as an isolated process in user space on the host OS. A list of running containers can be seen using the docker ps command.
  • 5. Vocabulary: Daemon & Client Docker daemon - The background service running on the host that manages building, running and distributing Docker containers. Docker client - The command line tool that allows the user to interact with the Docker daemon.
  • 6. Vocabulary: Hub Docker Hub - A registry of Docker images. You can think of the registry as a directory of all available Docker images.
  • 7. Run a static website in a container docker run nginx docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 585e0876dad1 nginx "nginx -g 'daemon ..." About a minute ago Up About a minute 80/tcp, 443/tcp goofy_payne docker stop 585e0876dad1 docker rm 585e0876dad1
  • 8. Run a static website in a container (Successful) docker run -d -P nginx docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 585e0876dad1 nginx "nginx -g 'daemon ..." About a minute ago Up About a minute 0.0.0.0:32769->80/tcp, goofy_payne 0.0.0.0:32768->443/tcp docker port goofy_payne 443/tcp -> 0.0.0.0:32768 80/tcp -> 0.0.0.0:32769
  • 9. Run a static website in a container (Successful) Attempt #2 docker run --name static-site -d -p 8888:80 nginx docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0f21f39e4cfa nginx "nginx -g 'daemon ..." About a minute ago Up About a minute 0.0.0.0:8888->80/tcp, static-site 443/tcp docker rm -f static-site
  • 10. Docker Images To see the list of images that are available locally on your system, run the docker images command. docker images REPOSITORY TAG IMAGE ID CREATED SIZE busybox latest 00f017a8c2a6 2 months ago 1.11 MB hello-world latest 48b5124b2768 3 months ago 1.84 kB nginx latest 4a88d06e26f4 7 months ago 184 MB Also you could pull a specific version of image as follows: docker pull node:0.10
  • 11. Docker search To get a new Docker image you can either get it from a registry (such as the Docker Hub) or create your own. There are hundreds of thousands of images available on Docker hub. You can also search for images directly from the command line using docker search.
  • 12. Base & Child Images An important distinction with regard to images is between base images and child images. ● Base images are images that have no parent images, usually images with an OS like ubuntu, alpine or debian. ● Child images are images that build on base images and add additional functionality.
  • 13. Official & User Images Official Another key concept is the idea of official images and user images. (Both of which can be base images or child images.) ● Official images are Docker sanctioned images. Docker, Inc. sponsors a dedicated team that is responsible for reviewing and publishing all Official Repositories content. This team works in collaboration with upstream software maintainers, security experts, and the broader Docker community. These are not prefixed by an organization or username. In the list of images above, the python, node, alpine and nginx images are official (base) images.
  • 14. Official & User Images User ● User images are images created and shared by users like you. They build on base images and add additional functionality. Typically these are formatted as user/image-name. The user value in the image name is your Docker Hub user or organization name.
  • 15. Dockerfile commands summary FROM FROM starts the Dockerfile. It is a requirement that the Dockerfile must start with the FROM command. Images are created in layers, which means you can use another image as the base image for your own. The FROM command defines your base layer. As arguments, it takes the name of the image. Optionally, you can add the Docker Hub username of the maintainer and image version, in the format username/imagename:version.
  • 16. Dockerfile commands summary RUN RUN is used to build up the Image you're creating. For each RUN command, Docker will run the command then create a new layer of the image. This way you can roll back your image to previous states easily. The syntax for a RUN instruction is to place the full text of the shell command after the RUN (e.g., RUN mkdir /user/local/foo). This will automatically run in a /bin/sh shell. You can define a different shell like this: RUN /bin/bash -c 'mkdir /user/local/foo'
  • 17. Dockerfile commands summary COPY & CMD COPY copies local files into the container. CMD defines the commands that will run on the Image at start-up. Unlike a RUN, this does not create a new layer for the Image, but simply runs the command. There can only be one CMD per a Dockerfile/Image. If you need to run multiple commands, the best way to do that is to have the CMD run a script. CMD requires that you tell it where to run the command, unlike RUN. So example CMD commands would be: CMD ["python", "./app.py"] CMD ["/bin/bash", "echo", "Hello World"]
  • 18. Dockerfile commands summary Expose & Push EXPOSE opens ports in your image to allow communication to the outside world when it runs in a container. PUSH pushes your image to Docker Hub, or alternately to a private registry
  • 19. Build image docker build -t oleksandrkovalov/node_example . docker run -d -p 8080:3000 oleksandrkovalov/node_example
  • 20. Push image docker login docker push oleksandrkovalov/node_example The push refers to a repository [docker.io/oleksandrkovalov/node_example] a6cc0f5939b9: Pushed ... 5d6cbe0dbcf9: Pushed latest: digest: sha256:239f102592ae13843da87bd61225fe40c686e869ff747f6e613dde8806c99009 size: 2837
  • 21. Container logging ● Container PID 1 process output can be viewed with docker logs command ● Will show whatever PID 1 writes to stdout View the output of the containers PID 1 process docker logs <container name> View and follow the output docker logs -f <container name>
  • 22. Container application logs ● Typically, apps have a well defined log location ● Map a host folder to the application’s log folder in the container ● In this way you can view the log generated in the container from your host folder Run a container using nginx image and mount a volume to map the /tmp/nginxlogs folder in the host to the /var/log/nginx folder in the container docker run -d -P -v /tmp/nginxlogs:/var/log/nginx nginx
  • 23. Private registry ● Allows you to run own registry instead of using Docker Hub ● Multiple options ○ Run registry server using container ○ Docker Hub Enterprise ● Two versions ○ Registry 1.0 for Docker 1.5 and below ○ Registry 2.0 for Docker 1.6
  • 24. Setting up private registry ● Run a registry inside a container ● Use the registry image at http://registry.hub.docker.com/u/library/registry ● Image contains pre-configured registry v2.0 Run registry: docker run -d -p 5000:5000 registry
  • 25. Push and pull from private registry ● First tag image with host IP or domain of registry server, then run docker push Tag image and specify the registry host: docker tag <image id> localhost:5000/my-app:1.0 Push image to registry: docker push localhost:5000/my-app:1.0 Pull image from registry: docker pull localhost:5000/my-app:1.0