I will try to cover the Docker basics in different posts to allow people and reader understand more about this tools, also i will provide reference in each of the posts in case you need more information:-
- Set up your Docker environment
- Build an image and run it as one container
- Scale your app to run multiple containers
- Distribute your app across a cluster
- Stack services by adding a backend database
- Deploy your app to production
To Understand docker more you can imagine or can been seen as computer inside your current computer, the most cool thing about docker is that you will not even feel that there is another computer running inside your computer and share the same resource of your computer, include to that if you friend ask for the same container all you have to do is send it to them and they will have the same output for anything running at this container.
Why Should i use docker when there are similar solution :-
- Very simple to configure.
- Docker provides this same capability without the overhead of a virtual machine
- Code management
- Docker provides a consistent environment for the application from dev through production, easing the code development and deployment pipeline.
- App Isolation.
- Server Consolidation.
There is more than these reasons to use docker but i choose to mentioned the one i used docker for, since it will be more reliable and trusted to share something i already done it and used it before.
Basic Vocabulary that you should understand before using Docker:-
- Container Vs Image
- This is very common question to people who using docker what is the difference between container and image ? so the answer is very simple, Container is running the image but not vice versa, so the container is launched by running an image, and the image is group of executable package that include everything you can imagine to run the application such as libraries, code, .. etc.
- Containers vs Virtual Machine
- i mentioned earlier that containers/Docker could computer inside your computer which means it’s running on your operating system without any third party solution or client, and share the same resource of your PC, runs a discrete process, taking no more memory than any other executable, making it lightweight.
- VM it’s totally different solution which is could be installed in two different way, the first one installed client that control the Server resource using another software such as VMware and ESXI, or the native way for example vmware workstation that installed on the guest PC.
First example on Docker
- install Docker, Docker could be installed on different operating system distribution you can check here
- Yum install docker-engine
- service docker start
- to check the current version of docker
- docker –version
- The last useful command which listing your image, the image as i already mentioned is executable package to run your code and each image having different executable file depends on your docker purpose.
The first command listing all the images under your machine, the second one List the hello-world image that was downloaded to your machine.
i will update you with part 2 soon.