Docker -The underlying technology
Docker is written in Go and takes advantage of several features of the Linux kernel to deliver its functionality.
Namespaces
Docker uses a technology called namespaces to provide the isolated workspace called the container. When you run a container, Docker creates a set of namespaces for that container.
These namespaces provide a layer of isolation. Each aspect of a container runs in a separate namespace and its access is limited to that namespace.
Docker Engine uses namespaces such as the following on Linux:
The pid namespace: Process isolation (PID: Process ID).
The net namespace: Managing network interfaces (NET: Networking).
The ipc namespace: Managing access to IPC resources (IPC: InterProcess Communication).
The mnt namespace: Managing filesystem mount points (MNT: Mount).
The uts namespace: Isolating kernel and version identifiers. (UTS: Unix Timesharing System).
Control groups
Docker Engine on Linux also relies on another technology called control groups (cgroups). A cgroup limits an application to a specific set of resources. Control groups allow Docker Engine to share available hardware resources to containers and optionally enforce limits and constraints. For example, you can limit the memory available to a specific container.
Docker commit
Description :
Create a new image from a container’s changes
Syntax
docker commit <<container id>> <<new image name>>
Example ( To create an image from container1)
docker commit container1 webserverimg
Docker save
Save one or more images to a tar archive (streamed to STDOUT by default)
Example
docker save mywebserver > mywebserver.tar
docker load
Load an image from a tar archive or STDIN
Example
docker load < mywebserver.tar
Docker Export and Import
docker export command is used to create a tar file from running/stopped container
docker import command to load the tar file into a docker image
docker export c2 -o img.tar
docker import img.tar test/img1
Comments
Post a Comment