0% found this document useful (0 votes)
21 views9 pages

DOCKER

Docker containers are lightweight runtime instances of Docker images that package applications with their dependencies. They differ from virtual machines in that they share the host OS kernel and are more resource-efficient. Docker images serve as the source code for containers, containing all necessary components, and can be stored and managed in Docker registries like Docker Hub.

Uploaded by

ab4216466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views9 pages

DOCKER

Docker containers are lightweight runtime instances of Docker images that package applications with their dependencies. They differ from virtual machines in that they share the host OS kernel and are more resource-efficient. Docker images serve as the source code for containers, containing all necessary components, and can be stored and managed in Docker registries like Docker Hub.

Uploaded by

ab4216466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

DOCKER

Docker Container:
1)what is Docker Container?
2)Docker container vs Virtualization
3)Benefits of Docker container
4) Container Application?
5)Hoe do create Docker Container?

1) Docker Container:
Docker container is a runtime instance of an image.
Allows developers to package applications with all parts needed
such as libraries and other dependencies
Docker Containers are runtime instances of
Docker images.
For eg.- Suppose there is an image of Ubuntu
OS with NGINX SERVER when this image is run with the docker
run command, then a container will be created and NGINX
SERVER will be running on Ubuntu OS

2) Docker container vs Virtualization:

The following are the differences between docker containers and


Virtual Machines:
Docker Containers Virtual Machines

Virtual Machines (VMs) run on


Docker Containers contain
Hypervisors, which allow
binaries, libraries, and
multiple Virtual Machines to run
configuration files along with
on a single machine along with
the application itself.
its own operating system.

Each VM has its own copy of


They don’t contain a guest OS
an operating system along with
for each container and rely on
the application and necessary
the underlying OS kernel,
binaries, which makes it
which makes the containers
significantly larger and it
lightweight.
requires more resources.

Containers share resources


They provide Hardware-level
with other containers in the
process isolation and are slow
same host OS and provide
to boot.
OS-level process isolation.

3) Benefits of Docker container:

Benefits of using containers in the cloud include:

• Speed
• Consistency
• Density
• Resource efficiency
• Portability (write once, run anywhere)
4)Container Application:

5)How do Docker container create?

Examples of Docker Container Create


The following are the examples of Docker Container Create with
different options:
1. Adding –add-host option
• This command creates the container with mapping the custom
hostname to the host IP. The commands as follows:
docker container create --add-host
myhost:192.168.1.100 my_image
2. Adding -a, –attach option
• On usage -a or –attach option with docker container create
facilities with creating the container having attachments to its
STDIN, STDOUT or STDERR:
docker container create -a my_container
3. On Adding -e, –env
• On usage of -e or –env with docker container create facilitates
on setting the environmental variables for the container which
is necessary while using Database Images.
docker container create -e
MYSQL_ROOT_PASSWORD=password my_image
4. On Adding -m, –memory
• On usage of docker container create with options -m, –
memory, we are creating the containers with a memory limit of
512 MB based on the docker image. The commands looks as
follows:
docker container create -m 512m my_image

Docker Image:

1)What is Docker Image?


2)Components of Docker Image
3)Uses of Docker Images
4)Difference between Docker Image Vs Docker
Container
5)Structure Of Docker Image
1)Docker Image:
A docker image is a platform-independent
image that can be built in the Windows environment and it can
be pushed to the docker hub and pulled by others with different
OS environments like Linux.
Docker image is very light in weight so can be
portable to different platforms very easily.

2)Components of Docker Images:


The following are the terminologies and components related to
Docker Image:
• Layers: Immutable filesystem layers stacked to form a
complete image.
• Base Image: The foundational layer, often a minimal OS or
runtime environment.
• Dockerfile: A text file containing instructions to build a Docker
image.
• Image ID: A unique identifier for each Docker image.
• Tags: Labels used to manage and version Docker images.

3)Uses of Docker Image:


The following are the uses of Docker Images:
1. We can easily and effectively run the containers with the aid of
docker images.
2. All the code, configuration settings, environmental variables,
libraries, and runtime are included in a Docker image.
3. Docker images are platform-independent.
4. Layers are the building blocks of an image.
5. WithWhen using the build command, the user has the option
of completely starting from scratch or using an existing image
for the first layer.

4)Structure of Docker Image:


The layers of software that make up a Docker image make it
easier to configure the dependencies needed to execute the
container.
• Base Image: The basic image will be the starting point for the
majority of Dockerfiles, and it can be made from scratch.
• Parent Image: The parent image is the image that our image
is based on. We can refer to the parent image in the
Dockerfile using the FROM command, and each declaration
after that affects the parent image.
• Layers: Docker images have numerous layers. To create a
sequence of intermediary images, each layer is created on top
of the one before it.
• Docker Registry: Docker Registry is a centralized storage
and distributed system for collecting and managing the docker
images.


5)Docker Image vs Container:

The following are the difference between Docker Image and


Container.
Docker image Docker container

The Docker image is the


The Docker container is the
Docker container’s source
instance of the Docker image.
code.

Dockerfile is a prerequisite to Docker Image is a pre-


Docker Image. requisite to Docker Container.

Docker images can be shared


Docker containers can’t be
between users with the help of
shared between the users.
the Docker Registry.

To make changes in the We can directly interact with


docker image we need to the container and can make
make changes in Dockerfile. the changes required.

Docker Repositories:

A Docker repository is a collection of different


Docker images with the same name, that have different tags.
Tags basically are identifiers of the image within a repository
how to host public repositories on docker hub which is a hosted
repository service provided by Docker for finding and sharing
container images

What is Docker Registry?


A Docker registry is a service that stores and
manages Docker images. A Docker registry could be hosted by a
third party, as a public or private registry. Some examples of
Docker registries are as follows:
• Docker Hub
• GitLab
• AWS Container Registry
• Google Container Registry
• Docker – Private Registries
• Git Hub container Registry

Docker Hub

For all of the images that your Docker


containers may require, DockerHub serves as a sizable storage
area.
There are two kinds: private and public.

• Public Repositories: These imitate public shelves where


anyone can take a picture. Just know the name of the Jenkins
continuous integration server, like “jenkins/jenkins.”
• Private Repositories: These like locked storage spaces to
which only specific individuals possess the key. They are
handy if you want to restrict who can view and access your
images.
• Official Repositories: Consider themselves to be the
standard. They undergo security and best practices checks, so
you can be sure they are reliable. You only need to provide
the image name, such as “nginx,” without providing the user
name or company.
• Automated Builds: One of DockerHub’s many distinctive
characteristics is its capacity to produce images automatically
anytime the source code is updated. It feels like a robot is
doing the hard work for you!
• Security Scanning: Like a security guard checking packages
for any hidden threats, DockerHub can also check your
images for vulnerabilities.

You might also like