SlideShare a Scribd company logo
Lorem Ipsum Dolor
Docker Quiz
Ganesh & Hari
ganesh@codeops.tech
hari@codeops.tech
1. Question
What is the name of the container runtime used by
Docker? (hint: it is from Open Container Initiative)
1. Answer
RunC (see https://runc.io/)
$ docker info | grep -i runc
Runtimes: runc
Default Runtime: runc
2. Question
What happens when you execute this on the command-
line?
docker run debian /bin/sh
A. A prompt from the shell of created container will be thrown to you
B. A container is created and then exited immediately
C. A container is created and executes in the detached mode; you can
attach to it later using the container id
D. Docker CLI issues the error: Error response from daemon: No
command specified.
2. Answer
When you execute this command,
docker run debian /bin/sh
A container is created and then exited immediately.
$ docker ps -a
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS NAMES
4c12998fd392 debian "/bin/bash"
6 seconds ago Exited (0) 5 seconds ago sick_panini
3. Question
What happens when you execute this on the command-
line with -p option?
$ docker run -p 80-87:80 --name nginx3 -d nginx
A. The port 80 in the container is mapped to ports 80 and 87 in the
host machine
B. The port 80 in the hostmachine is mapped to ports 80 and 87 in
the container
C. The port 80 in the container is mapped to a port in the range 80 to
87 in the host machine
D. Docker CLI will issue the error:“Invalid syntax: Using hyphen is not
allowed with -P command”
3. Answer
The option “-p 80-87:80” maps the port 80 in the container to a port
(based on the availability) in the range 80 to 87 in the host machine; this
is called “port range”
Example:
docker port nginx3
80/tcp -> 0.0.0.0:82
4. Question
Which command do you use “to find layers and their
sizes” in an image using Docker CLI?
A. Use “docker images -layers <<imageid>>” command
B. Use “docker layers <<imageid>> command
C. Use “docker history <<imageid>> command
D. There is no way you can find layers and their sizes using Docker CLI
- you need to use external tools
4. Answer
To find layers and their sizes in an image using Docker
CLI, use“docker history <<imageid>> command.
$ docker history google/cadvisor
IMAGE CREATED CREATED BY SIZE
COMMENT
106e303be3a4 2 weeks ago /bin/sh -c #(nop) ENTRYPOINT ["/usr/bin/cadvi 0 B
<missing> 2 weeks ago /bin/sh -c #(nop) EXPOSE 8080/tcp 0 B
<missing> 2 weeks ago /bin/sh -c #(nop) ADD file:1bde294f31142b3dee 25.87 MB
<missing> 2 weeks ago /bin/sh -c apk --no-cache add ca-certificates 17.13 MB
<missing> 2 weeks ago /bin/sh -c #(nop) ENV GLIBC_VERSION=2.23-r3 0 B
<missing> 2 weeks ago /bin/sh -c #(nop) MAINTAINER dengnan@google.c 0 B
<missing> 3 months ago /bin/sh -c #(nop) ADD file:852e9d0cb9d906535a 4.799 MB
5. Question
Which command do you use “recreate the Dockerfile
that was used to build that image” from a given image
id/tag using Docker CLI?
A. Use “docker images -dockerfile <<imageid>>” command
B. Use “docker build -reverse <<imageid>> command
C. Use “docker history --no-trunc --out:<filename> <<imageid>>
command
D. There is no way to recreate the Dockerfile that was used to build
that image from a given image id/tag using Docker CLI
5. Answer
There is NO way to recreate the Dockerfile that was used to build that
image from a given image id/tag using Docker CLI.
Think about Makefile: can you recreate the Makefile that was used to
build that executable file? No.
However, you can see the commands used to create the layers in the
image. Pass “—no-trunc” option to “docker history” command.
Example: “docker history --no-trunc google/cadvisor"
Try it now!
6. Question
You are creating a new container with this command:
docker run -d --name myubuntu ubuntu /bin/sh -c "while true; do echo current date and
time is: $(date); sleep 10; done”
Which network is the “myubuntu” container attached
to?
A. Bridge network
B. Overlay network
C. Custom network
D. Host network
E. None (not connected to any network)
6. Answer
Bridge network. By default, a newly created container is attached to the
bridge network (unless a different network is specified, for example, using
the “—network” option with the docker run command).
$ docker network inspect bridge
[
{
"Name": “bridge",
// ...
"Containers": {
"04579b88a74c981ae854261dffc7ab17328c28bb6fafec0f9c1e9431e77b3b27": {
"Name": "myubuntu",
"EndpointID":
"8a0e7a2559eac35eb60a90e85554679de276bd1ba39ff3a4083301d08e9ee384",
"MacAddress": "02:42:ac:11:00:03",
"IPv4Address": "172.17.0.3/16",
"IPv6Address": ""
},
// ...
},
// ...
}
]
7. Question
Which one of the following is a recommended Docker
BEST PRACTICE?
A. Prefer using docker commit or docker import instead of using
docker build using Dockerfiles (for creating custom/new images)
B. Use --link for linking containers explicitly on the same host instead
of using default bridge network for inter container communication
(ICC)
C. Put ADD commands later in the Dockerfile because the source files
or executables may change but the earlier layers will not change (to
avoid “cache bursting”)
D. Use explicit file/dir paths (e.g., -v /usr/mydir:/usr/mydir) instead of
using named volumes created using “docker volume create”
command
7. Answer
Avoid cache bursting and make your Dockerfile cache friendly. Example:
Put ADD commands later in the Dockerfile - because the source files or
executables may change but the earlier layers will not change
Other three are bad practices:
❖ Prefer using docker build using Dockerfiles (for creating custom/
new images) instead of using docker commit or docker import
❖ Using default bridge network for inter container communication
(ICC) instead of --link for linking containers explicitly on the same
host
❖ Use named volumes created using “docker volume create”
command instead of explicit file/dir paths (e.g., -v /usr/mydir:/usr/
mydir)
8. Question
When you run this command, what will be the PID of /
bin/sh?
docker run -it alpine /bin/sh
A. PID 1
B. Same as the PID of the docker process in the host
C. PID 0
D. Don’t know ;) Its randomly assigned by Docker
8. Answer
PID 1
docker run -it alpine /bin/sh
$ docker run -it alpine /bin/sh
/ # ps
PID USER TIME COMMAND
1 root 0:00 /bin/sh
7 root 0:00 ps
/ #
9. Question
What does this command do?
“docker run --privileged -d docker:dind”
A. It runs “docker within docker”
B. It runs the monitoring tool for docker
C. It is equivalent to “docker exec” and attach to a running container
D. It is for debugging docker containers
9. Answer
“docker run --privileged -d docker:dind"
“docker:dind” is the official “Docker in Docker base image”
Upcoming bootcamps
h"ps://www.townscript.com/e/modernarch	(5th	Nov)		
h"ps://www.townscript.com/e/solid	(19th	Nov)		
h"ps://www.townscript.com/e/interneto<hings	(26th	Nov)		
h"ps://www.townscript.com/e/so<ware-architecture	(10	Oct)
Meetups
http://www.meetup.com/Core-Java-Meetup-Bangalore/ (12th Nov, lastminute.com)
https://www.meetup.com/Mobile-App-Developers-Bangalore-Meetup/ (26th Nov, Work-In)
http://www.meetup.com/JavaScript-Meetup-Bangalore/ (19th Nov, HPE)
http://www.meetup.com/Container-Developers-Meetup-Bangalore/ (Dec 3, Microsoft)
http://www.meetup.com/CloudOps-Meetup-Bangalore/ (12th Nov, lastminute.com)
ganesh@codeops.tech @GSamarthyam
www.codeops.tech slideshare.net/sgganesh
+91 98801 64463 bit.ly/ganeshsg
Ad

Recommended

Docker by Example - Basics
Docker by Example - Basics
CodeOps Technologies LLP
 
Containerization and Docker
Containerization and Docker
Megha Bansal
 
Docker 基礎介紹與實戰
Docker 基礎介紹與實戰
Bo-Yi Wu
 
A Hands-on Introduction to Docker
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
Status update-qemu-pcie
Status update-qemu-pcie
The Linux Foundation
 
Docker
Docker
SangtongPeesing
 
Docker Basics
Docker Basics
DuckDuckGo
 
CMake - Introduction and best practices
CMake - Introduction and best practices
Daniel Pfeifer
 
Unix shell scripting basics
Unix shell scripting basics
Manav Prasad
 
Docker Introduction
Docker Introduction
Peng Xiao
 
Fuse- Filesystem in User space
Fuse- Filesystem in User space
Danny Tseng
 
Docker Introduction
Docker Introduction
Jeffrey Ellin
 
Why Docker
Why Docker
dotCloud
 
Docker introduction
Docker introduction
Phuc Nguyen
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
GlobalLogic Ukraine
 
Character drivers
Character drivers
pradeep_tewani
 
Docker intro
Docker intro
Oleg Z
 
Docker Swarm Introduction
Docker Swarm Introduction
rajdeep
 
Docker introduction for the beginners
Docker introduction for the beginners
Juneyoung Oh
 
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
Linux Initialization Process (1)
Linux Initialization Process (1)
shimosawa
 
Docker Swarm for Beginner
Docker Swarm for Beginner
Shahzad Masud
 
Docker and containerization
Docker and containerization
Amulya Saxena
 
C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツール
MITSUNARI Shigeo
 
Platform Drivers
Platform Drivers
SysPlay eLearning Academy for You
 
Dart のコード自動生成の仕組みと、コード自動生成のパッケージを自作する方法について
Dart のコード自動生成の仕組みと、コード自動生成のパッケージを自作する方法について
Kosuke Saigusa
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
Ahmed El-Arabawy
 
Docker: From Zero to Hero
Docker: From Zero to Hero
fazalraja
 
Software Architecture - Quiz Questions
Software Architecture - Quiz Questions
CodeOps Technologies LLP
 
Continuous Integration
Continuous Integration
Stanislav Tiurikov
 

More Related Content

What's hot (20)

Unix shell scripting basics
Unix shell scripting basics
Manav Prasad
 
Docker Introduction
Docker Introduction
Peng Xiao
 
Fuse- Filesystem in User space
Fuse- Filesystem in User space
Danny Tseng
 
Docker Introduction
Docker Introduction
Jeffrey Ellin
 
Why Docker
Why Docker
dotCloud
 
Docker introduction
Docker introduction
Phuc Nguyen
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
GlobalLogic Ukraine
 
Character drivers
Character drivers
pradeep_tewani
 
Docker intro
Docker intro
Oleg Z
 
Docker Swarm Introduction
Docker Swarm Introduction
rajdeep
 
Docker introduction for the beginners
Docker introduction for the beginners
Juneyoung Oh
 
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
Linux Initialization Process (1)
Linux Initialization Process (1)
shimosawa
 
Docker Swarm for Beginner
Docker Swarm for Beginner
Shahzad Masud
 
Docker and containerization
Docker and containerization
Amulya Saxena
 
C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツール
MITSUNARI Shigeo
 
Platform Drivers
Platform Drivers
SysPlay eLearning Academy for You
 
Dart のコード自動生成の仕組みと、コード自動生成のパッケージを自作する方法について
Dart のコード自動生成の仕組みと、コード自動生成のパッケージを自作する方法について
Kosuke Saigusa
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
Ahmed El-Arabawy
 
Docker: From Zero to Hero
Docker: From Zero to Hero
fazalraja
 
Unix shell scripting basics
Unix shell scripting basics
Manav Prasad
 
Docker Introduction
Docker Introduction
Peng Xiao
 
Fuse- Filesystem in User space
Fuse- Filesystem in User space
Danny Tseng
 
Why Docker
Why Docker
dotCloud
 
Docker introduction
Docker introduction
Phuc Nguyen
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
GlobalLogic Ukraine
 
Docker intro
Docker intro
Oleg Z
 
Docker Swarm Introduction
Docker Swarm Introduction
rajdeep
 
Docker introduction for the beginners
Docker introduction for the beginners
Juneyoung Oh
 
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
Linux Initialization Process (1)
Linux Initialization Process (1)
shimosawa
 
Docker Swarm for Beginner
Docker Swarm for Beginner
Shahzad Masud
 
Docker and containerization
Docker and containerization
Amulya Saxena
 
C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツール
MITSUNARI Shigeo
 
Dart のコード自動生成の仕組みと、コード自動生成のパッケージを自作する方法について
Dart のコード自動生成の仕組みと、コード自動生成のパッケージを自作する方法について
Kosuke Saigusa
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
Ahmed El-Arabawy
 
Docker: From Zero to Hero
Docker: From Zero to Hero
fazalraja
 

Viewers also liked (20)

Software Architecture - Quiz Questions
Software Architecture - Quiz Questions
CodeOps Technologies LLP
 
Continuous Integration
Continuous Integration
Stanislav Tiurikov
 
Lambda Functions in Java 8
Lambda Functions in Java 8
Ganesh Samarthyam
 
Overview of Microservices
Overview of Microservices
CodeOps Technologies LLP
 
Building a serverless app
Building a serverless app
Vinay Krishna
 
Choosing Between Cross Platform of Native Development
Choosing Between Cross Platform of Native Development
CodeOps Technologies LLP
 
Mongo db
Mongo db
Athira Mukundan
 
DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture
CodeOps Technologies LLP
 
7 best quotes on dev ops
7 best quotes on dev ops
CodeOps Technologies LLP
 
Better java with design
Better java with design
Narayann Swaami
 
Introduction to chef
Introduction to chef
Krishna Kishore
 
Ops Meta-Metrics: The Currency You Pay For Change
Ops Meta-Metrics: The Currency You Pay For Change
John Allspaw
 
DevOps - A Gentle Introduction
DevOps - A Gentle Introduction
CodeOps Technologies LLP
 
Angular js
Angular js
Athira Mukundan
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
Ganesh Samarthyam
 
Java Concurrency by Example
Java Concurrency by Example
CodeOps Technologies LLP
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
CodeOps Technologies LLP
 
AngularJS Anatomy & Directives
AngularJS Anatomy & Directives
Digikrit
 
DevOps - A Gentle Introduction
DevOps - A Gentle Introduction
Ganesh Samarthyam
 
Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)
Heartin Jacob
 
Building a serverless app
Building a serverless app
Vinay Krishna
 
Choosing Between Cross Platform of Native Development
Choosing Between Cross Platform of Native Development
CodeOps Technologies LLP
 
DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture
CodeOps Technologies LLP
 
Ops Meta-Metrics: The Currency You Pay For Change
Ops Meta-Metrics: The Currency You Pay For Change
John Allspaw
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
Ganesh Samarthyam
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
CodeOps Technologies LLP
 
AngularJS Anatomy & Directives
AngularJS Anatomy & Directives
Digikrit
 
DevOps - A Gentle Introduction
DevOps - A Gentle Introduction
Ganesh Samarthyam
 
Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)
Heartin Jacob
 
Ad

Similar to Docker by Example - Quiz (20)

Lecture eight to be introduced in class.
Lecture eight to be introduced in class.
nigamsajal14
 
docker.pdf
docker.pdf
EishaTirRaazia1
 
ABCs of docker
ABCs of docker
Sabyrzhan Tynybayev
 
Docker Introductory workshop
Docker Introductory workshop
Runcy Oommen
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PROIDEA
 
Computer science docker file Week -6 to7
Computer science docker file Week -6 to7
jemy24r
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Docker
Docker
Mutlu Okuducu
 
Docker
Docker
Hussien Elhannan
 
Docker 101 - Intro to Docker
Docker 101 - Intro to Docker
Adrian Otto
 
Docker in a JS Developer’s Life
Docker in a JS Developer’s Life
GlobalLogic Ukraine
 
Docker as an every day work tool
Docker as an every day work tool
Przemyslaw Koltermann
 
Clouds and Tools: Cheat Sheets & Infographics
Clouds and Tools: Cheat Sheets & Infographics
Thomas Poetter
 
Docker Starter Pack
Docker Starter Pack
Saeed Hajizade
 
Docker @ Atlogys
Docker @ Atlogys
Atlogys Technical Consulting
 
Docker.pdf
Docker.pdf
UsamaMushtaq24
 
Optimizing Docker Images
Optimizing Docker Images
Brian DeHamer
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
Docker, Inc.
 
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Erica Windisch
 
Lecture eight to be introduced in class.
Lecture eight to be introduced in class.
nigamsajal14
 
Docker Introductory workshop
Docker Introductory workshop
Runcy Oommen
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PROIDEA
 
Computer science docker file Week -6 to7
Computer science docker file Week -6 to7
jemy24r
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Docker 101 - Intro to Docker
Docker 101 - Intro to Docker
Adrian Otto
 
Docker in a JS Developer’s Life
Docker in a JS Developer’s Life
GlobalLogic Ukraine
 
Clouds and Tools: Cheat Sheets & Infographics
Clouds and Tools: Cheat Sheets & Infographics
Thomas Poetter
 
Optimizing Docker Images
Optimizing Docker Images
Brian DeHamer
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
Docker, Inc.
 
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Erica Windisch
 
Ad

More from CodeOps Technologies LLP (20)

AWS Serverless Event-driven Architecture - in lastminute.com meetup
AWS Serverless Event-driven Architecture - in lastminute.com meetup
CodeOps Technologies LLP
 
Understanding azure batch service
Understanding azure batch service
CodeOps Technologies LLP
 
DEVOPS AND MACHINE LEARNING
DEVOPS AND MACHINE LEARNING
CodeOps Technologies LLP
 
SERVERLESS MIDDLEWARE IN AZURE FUNCTIONS
SERVERLESS MIDDLEWARE IN AZURE FUNCTIONS
CodeOps Technologies LLP
 
BUILDING SERVERLESS SOLUTIONS WITH AZURE FUNCTIONS
BUILDING SERVERLESS SOLUTIONS WITH AZURE FUNCTIONS
CodeOps Technologies LLP
 
APPLYING DEVOPS STRATEGIES ON SCALE USING AZURE DEVOPS SERVICES
APPLYING DEVOPS STRATEGIES ON SCALE USING AZURE DEVOPS SERVICES
CodeOps Technologies LLP
 
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
CodeOps Technologies LLP
 
CREATE RELIABLE AND LOW-CODE APPLICATION IN SERVERLESS MANNER
CREATE RELIABLE AND LOW-CODE APPLICATION IN SERVERLESS MANNER
CodeOps Technologies LLP
 
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CodeOps Technologies LLP
 
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
CodeOps Technologies LLP
 
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
CodeOps Technologies LLP
 
Deploy Microservices To Kubernetes Without Secrets by Reenu Saluja
Deploy Microservices To Kubernetes Without Secrets by Reenu Saluja
CodeOps Technologies LLP
 
Leverage Azure Tech stack for any Kubernetes cluster via Azure Arc by Saiyam ...
Leverage Azure Tech stack for any Kubernetes cluster via Azure Arc by Saiyam ...
CodeOps Technologies LLP
 
YAML Tips For Kubernetes by Neependra Khare
YAML Tips For Kubernetes by Neependra Khare
CodeOps Technologies LLP
 
Must Know Azure Kubernetes Best Practices And Features For Better Resiliency ...
Must Know Azure Kubernetes Best Practices And Features For Better Resiliency ...
CodeOps Technologies LLP
 
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
CodeOps Technologies LLP
 
Jet brains space intro presentation
Jet brains space intro presentation
CodeOps Technologies LLP
 
Functional Programming in Java 8 - Lambdas and Streams
Functional Programming in Java 8 - Lambdas and Streams
CodeOps Technologies LLP
 
Distributed Tracing: New DevOps Foundation
Distributed Tracing: New DevOps Foundation
CodeOps Technologies LLP
 
"Distributed Tracing: New DevOps Foundation" by Jayesh Ahire
"Distributed Tracing: New DevOps Foundation" by Jayesh Ahire
CodeOps Technologies LLP
 
AWS Serverless Event-driven Architecture - in lastminute.com meetup
AWS Serverless Event-driven Architecture - in lastminute.com meetup
CodeOps Technologies LLP
 
BUILDING SERVERLESS SOLUTIONS WITH AZURE FUNCTIONS
BUILDING SERVERLESS SOLUTIONS WITH AZURE FUNCTIONS
CodeOps Technologies LLP
 
APPLYING DEVOPS STRATEGIES ON SCALE USING AZURE DEVOPS SERVICES
APPLYING DEVOPS STRATEGIES ON SCALE USING AZURE DEVOPS SERVICES
CodeOps Technologies LLP
 
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
CodeOps Technologies LLP
 
CREATE RELIABLE AND LOW-CODE APPLICATION IN SERVERLESS MANNER
CREATE RELIABLE AND LOW-CODE APPLICATION IN SERVERLESS MANNER
CodeOps Technologies LLP
 
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CodeOps Technologies LLP
 
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
CodeOps Technologies LLP
 
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
CodeOps Technologies LLP
 
Deploy Microservices To Kubernetes Without Secrets by Reenu Saluja
Deploy Microservices To Kubernetes Without Secrets by Reenu Saluja
CodeOps Technologies LLP
 
Leverage Azure Tech stack for any Kubernetes cluster via Azure Arc by Saiyam ...
Leverage Azure Tech stack for any Kubernetes cluster via Azure Arc by Saiyam ...
CodeOps Technologies LLP
 
YAML Tips For Kubernetes by Neependra Khare
YAML Tips For Kubernetes by Neependra Khare
CodeOps Technologies LLP
 
Must Know Azure Kubernetes Best Practices And Features For Better Resiliency ...
Must Know Azure Kubernetes Best Practices And Features For Better Resiliency ...
CodeOps Technologies LLP
 
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
CodeOps Technologies LLP
 
Functional Programming in Java 8 - Lambdas and Streams
Functional Programming in Java 8 - Lambdas and Streams
CodeOps Technologies LLP
 
Distributed Tracing: New DevOps Foundation
Distributed Tracing: New DevOps Foundation
CodeOps Technologies LLP
 
"Distributed Tracing: New DevOps Foundation" by Jayesh Ahire
"Distributed Tracing: New DevOps Foundation" by Jayesh Ahire
CodeOps Technologies LLP
 

Recently uploaded (20)

Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
University Campus Navigation for All - Peak of Data & AI
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
From Data Preparation to Inference: How Alluxio Speeds Up AI
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Why Edge Computing Matters in Mobile Application Tech.pdf
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
University Campus Navigation for All - Peak of Data & AI
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
From Data Preparation to Inference: How Alluxio Speeds Up AI
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 

Docker by Example - Quiz

  • 2. 1. Question What is the name of the container runtime used by Docker? (hint: it is from Open Container Initiative)
  • 3. 1. Answer RunC (see https://runc.io/) $ docker info | grep -i runc Runtimes: runc Default Runtime: runc
  • 4. 2. Question What happens when you execute this on the command- line? docker run debian /bin/sh A. A prompt from the shell of created container will be thrown to you B. A container is created and then exited immediately C. A container is created and executes in the detached mode; you can attach to it later using the container id D. Docker CLI issues the error: Error response from daemon: No command specified.
  • 5. 2. Answer When you execute this command, docker run debian /bin/sh A container is created and then exited immediately. $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4c12998fd392 debian "/bin/bash" 6 seconds ago Exited (0) 5 seconds ago sick_panini
  • 6. 3. Question What happens when you execute this on the command- line with -p option? $ docker run -p 80-87:80 --name nginx3 -d nginx A. The port 80 in the container is mapped to ports 80 and 87 in the host machine B. The port 80 in the hostmachine is mapped to ports 80 and 87 in the container C. The port 80 in the container is mapped to a port in the range 80 to 87 in the host machine D. Docker CLI will issue the error:“Invalid syntax: Using hyphen is not allowed with -P command”
  • 7. 3. Answer The option “-p 80-87:80” maps the port 80 in the container to a port (based on the availability) in the range 80 to 87 in the host machine; this is called “port range” Example: docker port nginx3 80/tcp -> 0.0.0.0:82
  • 8. 4. Question Which command do you use “to find layers and their sizes” in an image using Docker CLI? A. Use “docker images -layers <<imageid>>” command B. Use “docker layers <<imageid>> command C. Use “docker history <<imageid>> command D. There is no way you can find layers and their sizes using Docker CLI - you need to use external tools
  • 9. 4. Answer To find layers and their sizes in an image using Docker CLI, use“docker history <<imageid>> command. $ docker history google/cadvisor IMAGE CREATED CREATED BY SIZE COMMENT 106e303be3a4 2 weeks ago /bin/sh -c #(nop) ENTRYPOINT ["/usr/bin/cadvi 0 B <missing> 2 weeks ago /bin/sh -c #(nop) EXPOSE 8080/tcp 0 B <missing> 2 weeks ago /bin/sh -c #(nop) ADD file:1bde294f31142b3dee 25.87 MB <missing> 2 weeks ago /bin/sh -c apk --no-cache add ca-certificates 17.13 MB <missing> 2 weeks ago /bin/sh -c #(nop) ENV GLIBC_VERSION=2.23-r3 0 B <missing> 2 weeks ago /bin/sh -c #(nop) MAINTAINER [email protected] 0 B <missing> 3 months ago /bin/sh -c #(nop) ADD file:852e9d0cb9d906535a 4.799 MB
  • 10. 5. Question Which command do you use “recreate the Dockerfile that was used to build that image” from a given image id/tag using Docker CLI? A. Use “docker images -dockerfile <<imageid>>” command B. Use “docker build -reverse <<imageid>> command C. Use “docker history --no-trunc --out:<filename> <<imageid>> command D. There is no way to recreate the Dockerfile that was used to build that image from a given image id/tag using Docker CLI
  • 11. 5. Answer There is NO way to recreate the Dockerfile that was used to build that image from a given image id/tag using Docker CLI. Think about Makefile: can you recreate the Makefile that was used to build that executable file? No. However, you can see the commands used to create the layers in the image. Pass “—no-trunc” option to “docker history” command. Example: “docker history --no-trunc google/cadvisor" Try it now!
  • 12. 6. Question You are creating a new container with this command: docker run -d --name myubuntu ubuntu /bin/sh -c "while true; do echo current date and time is: $(date); sleep 10; done” Which network is the “myubuntu” container attached to? A. Bridge network B. Overlay network C. Custom network D. Host network E. None (not connected to any network)
  • 13. 6. Answer Bridge network. By default, a newly created container is attached to the bridge network (unless a different network is specified, for example, using the “—network” option with the docker run command). $ docker network inspect bridge [ { "Name": “bridge", // ... "Containers": { "04579b88a74c981ae854261dffc7ab17328c28bb6fafec0f9c1e9431e77b3b27": { "Name": "myubuntu", "EndpointID": "8a0e7a2559eac35eb60a90e85554679de276bd1ba39ff3a4083301d08e9ee384", "MacAddress": "02:42:ac:11:00:03", "IPv4Address": "172.17.0.3/16", "IPv6Address": "" }, // ... }, // ... } ]
  • 14. 7. Question Which one of the following is a recommended Docker BEST PRACTICE? A. Prefer using docker commit or docker import instead of using docker build using Dockerfiles (for creating custom/new images) B. Use --link for linking containers explicitly on the same host instead of using default bridge network for inter container communication (ICC) C. Put ADD commands later in the Dockerfile because the source files or executables may change but the earlier layers will not change (to avoid “cache bursting”) D. Use explicit file/dir paths (e.g., -v /usr/mydir:/usr/mydir) instead of using named volumes created using “docker volume create” command
  • 15. 7. Answer Avoid cache bursting and make your Dockerfile cache friendly. Example: Put ADD commands later in the Dockerfile - because the source files or executables may change but the earlier layers will not change Other three are bad practices: ❖ Prefer using docker build using Dockerfiles (for creating custom/ new images) instead of using docker commit or docker import ❖ Using default bridge network for inter container communication (ICC) instead of --link for linking containers explicitly on the same host ❖ Use named volumes created using “docker volume create” command instead of explicit file/dir paths (e.g., -v /usr/mydir:/usr/ mydir)
  • 16. 8. Question When you run this command, what will be the PID of / bin/sh? docker run -it alpine /bin/sh A. PID 1 B. Same as the PID of the docker process in the host C. PID 0 D. Don’t know ;) Its randomly assigned by Docker
  • 17. 8. Answer PID 1 docker run -it alpine /bin/sh $ docker run -it alpine /bin/sh / # ps PID USER TIME COMMAND 1 root 0:00 /bin/sh 7 root 0:00 ps / #
  • 18. 9. Question What does this command do? “docker run --privileged -d docker:dind” A. It runs “docker within docker” B. It runs the monitoring tool for docker C. It is equivalent to “docker exec” and attach to a running container D. It is for debugging docker containers
  • 19. 9. Answer “docker run --privileged -d docker:dind" “docker:dind” is the official “Docker in Docker base image”
  • 21. Meetups http://www.meetup.com/Core-Java-Meetup-Bangalore/ (12th Nov, lastminute.com) https://www.meetup.com/Mobile-App-Developers-Bangalore-Meetup/ (26th Nov, Work-In) http://www.meetup.com/JavaScript-Meetup-Bangalore/ (19th Nov, HPE) http://www.meetup.com/Container-Developers-Meetup-Bangalore/ (Dec 3, Microsoft) http://www.meetup.com/CloudOps-Meetup-Bangalore/ (12th Nov, lastminute.com)