Docker
Docker
Docker
Once installed successfully, you should see a icon like this below in your desktop
tray. When you mouse hover, it should say Docker Desktop is running
docker version
Containers are completely isolated environment. They have their own Processors, Networks, and
Mounts, except that they share their own OS Kernels.
When you run the above command, it will first check whether you have any image in your local, if not, it
will try to download it and run it. This will display a diagram like whale and display the txt Hello World.
It is nothing but an already build Java Program, which someone has already uploaded to the docker
repository.
Running the above command, will download and run the ngnix command.
docker ps
The above displays like below, it doesn’t show anything which run before.
Run now -> docker ps -a
This will display the screen like below, which shows all the images which you ran before.
The containers are not meant to run operating system, it is meant to do a specific task, process, web
server or application server. Once the task is completed, it is existed. The container lives as long as
the process is alive.
-d is to detach the command execution, so that you can use the same command prompt.
You can see that nginx is now running, since you have provided the command sleep 20. After 20
seconds, if you run the ps command you will see no container running.
Browse for other docker commands in the net and practice, which is really needed for further work on
Kubernetes and Jenkins.