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 :)

More Related Content

What's hot

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ì
 

What's hot (20)

Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
 
Docker Presentation
Docker PresentationDocker Presentation
Docker Presentation
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
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
 
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
 
Docker Swarm & Machine
Docker Swarm & MachineDocker Swarm & Machine
Docker Swarm & Machine
 
Docker Distributed application bundle & Stack - Overview
Docker Distributed application bundle & Stack - Overview Docker Distributed application bundle & Stack - Overview
Docker Distributed application bundle & Stack - Overview
 
Docker / Ansible
Docker / AnsibleDocker / Ansible
Docker / Ansible
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
Docker 101 - Intro to Docker
Docker 101 - Intro to DockerDocker 101 - Intro to Docker
Docker 101 - Intro to Docker
 
Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
 
Docker compose
Docker composeDocker compose
Docker compose
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
 

Viewers also liked

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
 

Viewers also liked (9)

Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
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
 
Oracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic FunctionsOracle Advanced SQL and Analytic Functions
Oracle Advanced SQL and Analytic Functions
 
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...
 
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
 
Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
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
 

Similar to Academy PRO: Docker. Part 2

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, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker
DockerDocker
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
UsamaMushtaq24
 
Docker
DockerDocker
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
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podman
Thierry Gayet
 
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
 
Master Docker - first meetup
Master Docker - first meetupMaster Docker - first meetup
Master Docker - first meetup
Ayoub Benaissa
 
Docker
DockerDocker
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
thehoagie
 

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
 
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.
 
docker.pdf
docker.pdfdocker.pdf
docker.pdf
 
Docker @ Atlogys
Docker @ AtlogysDocker @ Atlogys
Docker @ Atlogys
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker
DockerDocker
Docker
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
Docker
DockerDocker
Docker
 
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
 
Tips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podmanTips pour sécuriser ses conteneurs docker/podman
Tips pour sécuriser ses conteneurs docker/podman
 
Docker 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
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
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
 
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
 
Master Docker - first meetup
Master Docker - first meetupMaster Docker - first meetup
Master Docker - first meetup
 
Docker
DockerDocker
Docker
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 

More from 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
 

More from Binary Studio (20)

Academy PRO: D3, part 1
Academy PRO: D3, part 1Academy PRO: D3, part 1
Academy PRO: D3, part 1
 
Academy PRO: Cryptography 3
Academy PRO: Cryptography 3Academy PRO: Cryptography 3
Academy PRO: Cryptography 3
 
Academy PRO: Cryptography 1
Academy PRO: Cryptography 1Academy PRO: Cryptography 1
Academy PRO: Cryptography 1
 
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 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 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
 
Academy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneousAcademy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneous
 
Academy PRO: React native - publish
Academy PRO: React native - publishAcademy PRO: React native - publish
Academy PRO: React native - publish
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
 
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
 
Academy PRO: React Native - introduction
Academy PRO: React Native - introductionAcademy PRO: React Native - introduction
Academy PRO: React Native - introduction
 
Academy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis BeketskyAcademy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis Beketsky
 
Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 

Recently uploaded

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 

Recently uploaded (20)

Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 

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