-->

Saturday, April 23, 2016

Docker Terms

Docker Engine:- 
Sometimes called docker daemon or docker runtime. It gets downloaded from apt-get or yum in linux whenever we install docker. It is responsible for providing access to all documents runtime and services.

Images:-
Images are what we launch docker containers from.
  docker run -it fedora /bin/bash  
In this example fedora is the image , it will launch fedora based container. Images comprises of different layers. Everytime we don't specify the image version it will pull the latest fedora version. For getting all the images use a -a flag in the docker pull command . For checking all the available images use
 docker images fedora  

Images have 5 fields associated with it.



  1. REPOSITORY are the repos from which we pull the images. Every repository have the different images for different versions which can be identified from the tags. 
  2. TAG is the way of identifying the images more like tagging of the images to identify them like a version etc. 
  3. IMAGE ID this is the unique number associated with each image type. 
  4. CREATED showing when the image was created. 
  5. VIRTUAL SIZE is the size of the image from which the container would be launched. 
Images contains all the metadata required to launch the docker container. Also we can pull the images from the docker hub using the
 docker pull  

Once downloaded the docker images are stored locally under the /var/lib/docker/

Docker hub:-
Public docker registry.

Containers:- 
Containers are launched from images. It can be thought as the running instances of the images. Images are the built time construct while containers are the run time construct. Docker run command looks for the specified image type , unpacks the image, build all the layers and run the container. A container is basically a running linux instance with minimum install i.e. no GUI , no unnecessary packages and thats because containers  gains its strength from light weight.

You can exit a container without killing it to host OS by running ( Ctrl + P + Q)

You can see the running docker containers using the docker ps command and -a flag shows all containers which have run on this host. Also a container name is assigned to each container and containers can be manipulated based on these names also apart from the Container ID.


Registry and Repositories:- 
We pull images from the repositories and repositories live inside Registry . The default public registry for docker is docker hub, so within docker hub there are a bunch of docker repository's like fedora , ubuntu, Redis, mongodb and because these are official repos they are like trusted repos. Within each repo there are different images like in case of ubuntu its 14.0.4 , 12.0.4 . You should always take precautions while running any user repo apart from the official repo and aware that it might contain something off security. Always run trusted repos only in your production environment.



0 comments:

Post a Comment