Build all these 5 images and run container and observe the use cases of it

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Docker File 1

	root@ip-172-31-28-155:/home/ubuntu/srm# docker build -f dockerfile1 -t image1 .
	Sending build context to Docker daemon  6.144kB
	Step 1/7 : FROM ubuntu
	 ---> fb52e22af1b0
	Step 2/7 : MAINTAINER Rajesh Kumar << rajesh@scmgalaxy.com>>
	 ---> Using cache
	 ---> 01477b86dfc8
	Step 3/7 : ENV DEBIAN_FRONTEND=noninteractive
	 ---> Using cache
	 ---> 57a1ad7c1cea
	Step 4/7 : RUN apt-get update
	 ---> Using cache
	 ---> 1207d5f945f3
	Step 5/7 : RUN apt-get -y install tzdata
	 ---> Using cache
	 ---> e99c418f5399
	Step 6/7 : RUN apt-get update && apt-get install git -y && apt-get install -yq apache2
	 ---> Using cache
	 ---> 0adfc67f9737
	Step 7/7 : CMD /usr/sbin/apache2ctl -D FOREGROUND
	 ---> Using cache
	 ---> f5b4a10dc064
	Successfully built f5b4a10dc064
	Successfully tagged image1:latest

	root@ip-172-31-28-155:/home/ubuntu/srm# docker run -it image1

Docker File 2

	root@ip-172-31-28-155:/home/ubuntu/srm# docker build -f dockerfile2 -t image2 .
	Sending build context to Docker daemon  6.144kB
	Step 1/7 : FROM ubuntu
	 ---> fb52e22af1b0
	Step 2/7 : MAINTAINER Rajesh Kumar << rajesh@scmgalaxy.com>>
	 ---> Using cache
	 ---> 01477b86dfc8
	Step 3/7 : ENV DEBIAN_FRONTEND=noninteractive
	 ---> Using cache
	 ---> 57a1ad7c1cea
	Step 4/7 : RUN apt-get update
	 ---> Using cache
	 ---> 1207d5f945f3
	Step 5/7 : RUN apt-get -y install tzdata
	 ---> Using cache
	 ---> e99c418f5399
	Step 6/7 : RUN apt-get update && apt-get install git -y && apt-get install -yq apache2
	 ---> Using cache
	 ---> 0adfc67f9737
	Step 7/7 : CMD echo "Hello world"
	 ---> Using cache
	 ---> f3008cf52e3f
	Successfully built f3008cf52e3f
	Successfully tagged image2:latest
	
	root@ip-172-31-28-155:/home/ubuntu/srm# docker run -it image2
	Hello world

Docker File 3

	root@ip-172-31-28-155:/home/ubuntu/srm# docker build -f dockerfile3 -t image3 .               Sending build context to Docker daemon  7.168kB
	Step 1/8 : FROM ubuntu
	 ---> fb52e22af1b0
	Step 2/8 : MAINTAINER Rajesh Kumar << rajesh@scmgalaxy.com>>
	 ---> Using cache
	 ---> 01477b86dfc8
	Step 3/8 : ENV DEBIAN_FRONTEND=noninteractive
	 ---> Using cache
	 ---> 57a1ad7c1cea
	Step 4/8 : RUN apt-get update
	 ---> Using cache
	 ---> 1207d5f945f3
	Step 5/8 : RUN apt-get update
	 ---> Using cache
	 ---> 4156a194a23b
	Step 6/8 : RUN apt-get -y install tzdata
	 ---> Using cache
	 ---> 9b31137fbd43
	Step 7/8 : RUN apt-get update && apt-get install git -y && apt-get install -yq apache2
	 ---> Using cache
	 ---> 17c90bab3df8
	Step 8/8 : ENTRYPOINT ["/bin/echo", "Hello"]
	 ---> Using cache
	 ---> faf040ddabad
	Successfully built faf040ddabad
	
	root@ip-172-31-28-155:/home/ubuntu/srm# docker run -it image3
	Hello

Docker File 4

	root@ip-172-31-28-155:/home/ubuntu/srm# docker build -f dockerfile4 -t image4 .
	Sending build context to Docker daemon  7.168kB
	Step 1/8 : FROM ubuntu
	 ---> fb52e22af1b0
	Step 2/8 : MAINTAINER Rajesh Kumar << rajesh@scmgalaxy.com>>
	 ---> Using cache
	 ---> 01477b86dfc8
	Step 3/8 : ENV DEBIAN_FRONTEND=noninteractive
	 ---> Using cache
	 ---> 57a1ad7c1cea
	Step 4/8 : RUN apt-get update
	 ---> Using cache
	 ---> 1207d5f945f3
	Step 5/8 : RUN apt-get -y install tzdata
	 ---> Using cache
	 ---> e99c418f5399
	Step 6/8 : RUN apt-get update && apt-get install git -y && apt-get install -yq apache2
	 ---> Using cache
	 ---> 0adfc67f9737
	Step 7/8 : EXPOSE 80
	 ---> Using cache
	 ---> d984750330b2
	Step 8/8 : CMD /usr/sbin/apache2ctl -D FOREGROUND
	 ---> Using cache
	 ---> ef7c01cfe904
	Successfully built ef7c01cfe904
	Successfully tagged image4:latest
	
	root@ip-172-31-28-155:/home/ubuntu/srm# docker run -it image4

Apache default page exposed to port 80

Docker File 5

	root@ip-172-31-28-155:/home/ubuntu/srm# docker build -f dockerfile5 -t image5 .               Sending build context to Docker daemon  7.168kB
	Step 1/8 : FROM ubuntu
	 ---> fb52e22af1b0
	Step 2/8 : MAINTAINER Rajesh Kumar << rajesh@scmgalaxy.com>>
	 ---> Using cache
	 ---> 01477b86dfc8
	Step 3/8 : ENV DEBIAN_FRONTEND=noninteractive
	 ---> Using cache
	 ---> 57a1ad7c1cea
	Step 4/8 : RUN apt-get update
	 ---> Using cache
	 ---> 1207d5f945f3
	Step 5/8 : RUN apt-get -y install tzdata
	 ---> Using cache
	 ---> e99c418f5399
	Step 6/8 : RUN apt-get install git -y && apt-get install -yq apache2
	 ---> Using cache
	 ---> a10251de0aa1
	Step 7/8 : CMD echo "Hello world"
	 ---> Using cache
	 ---> da7318408c65
	Step 8/8 : ENTRYPOINT ["/bin/echo", "Hello"]
	 ---> Using cache
	 ---> 95fd2176a9d8
	Successfully built 95fd2176a9d8
	Successfully tagged image5:latest
	
	root@ip-172-31-28-155:/home/ubuntu/srm# docker run -it image5
	Hello /bin/sh -c echo "Hello world"