Docker Devops: Let us look at docker. It is basically a docker container management tool. It is a container platform and it enables the users to create containers and run the applications. The idea is that each container runs only one instance of the application. If an application has a minimum footprint, it can run in the same container as another application. Docker also does not have a boot feature.
Initially, we have an image file that we can use to install a docker container. So from the outside, we have a docker and many containers. We have got the operating system and the Kernal, and everything else, Docker is just an application that runs on the operating system and enables you to run containers seamlessly as stand-alone applications. These applications are completely isolated from everything else.
Docker on Linux:
Docker is traditionally Linux. For a long time, it was only supported only on Linux. It uses the Kernal container functionality. It requires a 64-bit installation using Kernal version 3.1 or later. Docker runs on many popular Linux distributions. It runs on Debian, CentOS, Ubuntu. It is available as RPM, APT, or binary versions.
Docker on OS X
Docker for OS X came out fairly recently. It requires Mac OS Yosemite or newer. Earlier this year, it started running natively on OS X. DMG installs applications running in userspace. It is built on the xhyve hypervisor. It requires a 2010 Mac with Intel MMU and EPT support. This is because it needs memory management within the CPU and earlier Macs did not have it. It requires 3-4 GB of RAM, because it does not use up some memory.
Reinstalling the docker in Mac has issues as Docker is not able to communicate externally. Users can still use docker but they can not do certain tasks. Users have containers spread over multiple hosts.
It runs effectively if you run Linux things on Windows. Virtual Box for Virtual machines cannot be run at the same time because of Docker because of the hyper feedback
It is a Virtual Box and it uses Virtual Box and it is completely packaged Virtual Machine running a Linux operating system which has docker installed in it. Therefore we have access to an operating system that has docker and that can run other application.
Docker has a number of components as we will be seeing, it is a client-server and it has a background daemon process what does all the work and it also has to rest full API. This configuration normally works for the UNIX socket so it needs the API and the client socket run on the same machine. It can still listen to the TCP/IP port and communicate with the client on the remote server. This is one of the areas where we can not work using OS X. If OS X cannot connect with the server machine. It manages the container so it can fetch them, build them and run them and put them somewhere else. Containers are stored in many places.
Docker is a set of repositories up on the cloud and that enables you to get images of a vast number of things that are docker images for all of the major distributions of Linux and they have multiple versions of distributions of Linux. There are many dockers to choose from. The uses have a wide variety of docker to choose from. The users can also have custom docker also. The users can have the whole list of collection usually and the users do not have to get them all the time.
Images are template and they are usually reduced version of the Linux operating system and the users just add an application to the image. Basically, the images are template and the users just provide a set of operations to the images. It adds the layers to the container and the users get the complete image to run. There are all sorts of things
- The docker images are built in layers.
- The layers are combined in a Union file system to make a single image.
- Images are build components of Docker.
- The foundation is usually a prepared Linux operating system.
- Commands are defined in the Docker File.
If there is any change, the user does not have to download everything from scratch and rather have to do and download the change only. Image is read-only and we use the Docker Run command and the container is only the copy of the image. This is an actual container that is running the file system. It also creates an interface and has an IP address and the way it actually works is, the docker daemon acts as a gateway to a private internal network on the machine and the internal subnet and the container is actually attached to the subnet.
We can optionally connect the input/output error streams. We can also interact with the container if we wish to run the background process. When it is run, the docker container only appears as a child process. It shows the daemon process that started with certain options and then in process one is a child of Docker which is a container running, in this case, is a shell.
To run an image, it has to be on the computer. Docker itself has a collection of images and if it does not have one, it can be pulled from the registry. The pull command ensures that the specified image is on the local computer. It will transfer all constituent layers of the image as a separate transfer.
The run command creates and initiates the container based on the image.
If we run docker ps, it will list all the running containers.
Docker stats show the running container and resources usage.
The following command helps us name a docker.
Most commands will accept either the name of the id of the container.
To stop the container we can use them
The container can be removed using the rm command,
Attaching to the container attaches the container process’s STDIN, STDOUT, and STDERR:
We can attach to either the container ID or its name.
Several command prompt can attach to the same container process.
A tty session see the same inputs and outputs.
The container ID is about using ‘ps’
The container can be stopped using the command
It has -t parameter that has a default time of 10 seconds
The following command pauses all the processes in the container to sleep.
It does not use the SIGSTOP, SIGCONT mechanism as the process can see the signals.
It uses the ‘cgroups’ freeze mechanism where all the processes in a cgroup and its children are suspended without the process being aware.
The following command shows all the containers.
It will show all the container including the stopped ones.
This command will delete all the containers
Use the run command with the -d or the –detach switch
Signals can be sent using the kill command
We can get the version of the docker using
This will pull the docker from the registry and load it in the local cache.
run docker images to see what is stored in the computer
Image Id is used for identifying the docker image.
In this post, we saw what is Docker DevOps. The technical details of Docker DevOps and how it comes into picture when we talk about the Linux, Mac OS X operating system. Docker is also available on Windows as explained above.
There is some useful Docker command that we can use to install and check the status of the Docker Installation. For more information on Docker, please let us know in the comments below.