Docker is cool. It is a popular technology. This small tutorial of mine, just show how much powerfull docker is. But it is more vast than this small example.
Main or Basic Reasons :
Docker encapsulate everything an application needs to run. Thus it ease the creation, deploy and the delivery of an application.
Docker containers make things platform indepenent for any machine running docker
Docker containers has just the minimum set of operating system software needed for the application to run and also speed up performance, decrease the storage requirements.
In Simple Words
Let say you are working on a windows machine and you got a client who wants you to use nginx web server for some task immediately. Now you have no extra linux machine. Luckily you have docker client running on your windows machine and you know docker.
You need just approx 133MB and a command to get running nginx web server
docker run --name websrv -p 8080:80 nginx:latest
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
b4d181a07f80: Pull complete
66b1c490df3f: Pull complete
d0f91ae9b44c: Pull complete
baf987068537: Pull complete
6bbc76cbebeb: Pull complete
32b766478bc2: Pull complete
Status: Downloaded newer image for nginx:latest
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/07/08 19:03:22 [notice] 1#1: using the "epoll" event method
2021/07/08 19:03:22 [notice] 1#1: nginx/1.21.1
2021/07/08 19:03:22 [notice] 1#1: built by gcc 8.3.0 (Debian 8.3.0-6)
2021/07/08 19:03:22 [notice] 1#1: OS: Linux 5.4.0-74-generic
2021/07/08 19:03:22 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/07/08 19:03:22 [notice] 1#1: start worker processes
2021/07/08 19:03:22 [notice] 1#1: start worker process 31
2021/07/08 19:03:22 [notice] 1#1: start worker process 32
2021/07/08 19:03:22 [notice] 1#1: start worker process 33
2021/07/08 19:03:22 [notice] 1#1: start worker process 34
Open your browser and go to url http://localhost:8080/
You will see nginx welcome screen. Cool!
Not only this you can link this webserver image container to other images for example php / python and also assign your local folder to it as volume for storage of your files. You can achieve also this step by step using DockerFiles. After this you can push/pull this image for later access anywhere
For complete information on docker go to https://docs.docker.com/
Ok Readers! Bye for now. More will come but please help me to keep me out of shackles of poverty. For this please pay a small amount of money of your choice on my payment page. I will keep putting articles here. --- Dheeraj