Assignment 1 Day 2
What is Storage Driver and types of Storage Driver? Explain with Images.
A docker image can have different layers. When a container is created out of this image it will also have a writable layer on top of all the read only layers created out of the image. A storage driver manages all these layers making it appear as a single file system to the user. Multiple implementations of storage driver are available.
What is Docker Images and Explain 10 bullet lines?
A docker image contains all the dependencies needed to run an application
It is created as layers of file system on top of each other
Layering help update easy and efficient
When conflict happens, topmost layer gets precedence.
Any no.of containers can be created out of a single image
Create one Image which have base as centos and with git – ntp – httpd
used chrony instead of ntp
root@ip-172-31-28-155:/home/ubuntu# docker run -itd centos
docker attach 793a59b5cbbe
yum install git
yum install chrony
yum install httpd
docker commit -m”cent-git-chrony-httpd” 793a59b5cbbe cent-git-chrony-http
cent-git-chrony-http latest 62682df1872f 10 minutes ago 372MB
Create one Image which have base as ubuntu and with git – ntp – apache2.
root@ip-172-31-28-155:/home/ubuntu# docker run -itd ubuntu
docker attach 254f2f37b7a7
apt-get install git
apt-get install ntp
apt-get install apache2
docker commit -m”ubu-git-ntp-apa” 254f2f37b7a7 ubu-git-ntp-apa
ubu-git-ntp-apa latest 43175557dca4 About a minute ago 259MB
root@ip-172-31-28-155:/home/ubuntu# docker run -itd ubu-git-ntp-apa
root@ip-172-31-28-155:/home/ubuntu# docker exec 4c7c73feedd3 git
usage: git [–version] [–help] [-C ] [-c =]