docker for beginners.

docker for beginners.

Welcome to docker for beginners article, As we have seen in previous article getting-started-with-docker basic understanding of docker and installation of docker engine on ubuntu machine. In this this article we will discuss more about docker if you hadn't read previous article i will suggest you to read my previous article and then move to ahead. Basically in this article i have dicuss about Understanding the docker setup, client-server commmunication, Downloading first docker image, running the first docker container etc. 

Understanding the docker setup.

It's important to understand Docker's components and their versions, storage, exectution drivers, fie locations and so on. understanding of these components of docker setup would also reveal wheather the installation was successful or not. you can accomplish this by using docker subcommands:
  1. docker version.
  2. docker info.
Note: here i have used root user in my cases, in your case may be you are in regular user. if you are in regular user then you will have to use $ sudo docker version command to display info about docker engine.
Let's start our docker practicle with the docker version subcommand as show in the image.
Although the docker version subcommand lists many line of text/information, as a docker user, you should know what these following output lines mean:
  • The client version
  • The client API version
  • The server version
  • The server API version
The client and server versions that have been considered here are 19.03.7 and the client API and server API versions 1.40.

2. docker info : if you are in root user then not sudo docker info.
here i am not going to show you screenshot because this command display more thing about the docker engine and not possible to capture whole thing in a single snapshot. so, its you task to see what the information you will get . after using this subcommand you will get more information, then read line by line. i assumed that you have done this practicle.
As you can see in the output of a fresshly installed Docker engine, the number of containers and imges is invaribly nil.

The storage Driver has been set up as
Docker Root Dir: /var/lib/docker location.
Storage Driver: overlay2 or may be aufs, and the directory has been given the

The execution Driver has been set to the native mode. This command also lists details, such as the kernel version, operating system, the number of CPUs, the total memory, and Name the new docker hostname etc.

Client server communication.

server-client communication by using the Unix socket(/var/lib/docker.sock). Docker also has an IANA registered port, which is 2375. However, for security reasons, this port is not enabled by default.

Downloading the first Docker image.

The docker pull subcommand is used for downloading any number of images from registry. The docker registry is an application repository, which hosts a range of applicatins that vary between basic Linux images and advanced applications. i will download a tiny version of linux called the busybox iamge by using this command as i have show in the image below:
command: $sudo docker pull busybox


Using the default tag latest: the image you are pulling has been verified.
Status: Downloading newer iamge for busybox:latest. here latest is the tag of images it shows that this is official image.
once the images have been downloaded, they can be verified by using the docker images or docker image ls subcommands, as shown here:
$ sudo docker images
or
$ sudo docker image ls
both commands will display same output.

Running the first Docker container.

Now, you can start your first docker container. it is standard practice to start with the basic Hello World! application. In the following example, will echo Hello World! by using a busybox iamge, which we have already downloaded.
$sudo docker run busybox echo "Hello World!"
Congratulations! you have sucessfully lauch your first container. The docker run subcommand has been used for creating a container and for printing Hello World! by using the echo command.

i hope you have learned basic about docker. if you have any query from docker for beginners article then free feel to comment and if you like it then share it for my motivation. Thanks for reading the article from cybersploit.
 

 


Post a Comment

0 Comments