Skip to content

Latest commit

 

History

History
78 lines (42 loc) · 2.92 KB

Docker-Assignment.md

File metadata and controls

78 lines (42 loc) · 2.92 KB

DOCKER ASSIGNMENT

DevOps Workshop Training

$\textcolor{brown}{\text{Contact us: }}$        

T O A C C E L E R A T E Y O U R C A R E E R G R O W T H

For questions and more details:

+91 98712 72900
+91 98712 72900


$\textcolor{red}{\text{NOTE: USE UBUNTU 22.04 VIRTUAL MACHINES FOR ALL THE LABS}}$

Complete below exercises:

Exercise 1: Accomplish below task to complete this exercise:

a) Install docker on an Ubuntu GCP instance

b) Use docker pull to download docker images on this server

c) Use docker run to run nginx container using this image. Use below parameters for the container

  • i. Name: mynginx

  • ii. Host port: 80

  • iii. Container port: 80

  • iv. Should run in detach mode

d) Login to mynginx container and check the nginx process running or not. Ideally it should be running

e) Check if nginx is accessible on http://<Server_Pubilc_IP>:80 and you see below page:

image

Exercise 2: Accomplish below task to complete this exercise:

a) Create a Dockerfile to package below:

  • i. uses ubuntu docker image

  • ii. Install apache2 inside it

  • iii. Mount any local html file from host to /var/www/html path of container

  • iv. Uses command as entrypoint: ENTRYPOINT apachectl -D FOREGROUND

b) Create a sample html file with some content in the same directory as dockerfile

c) Once above Dockerfile is ready, perform below tasks:

  • i. Build the dockerfile with name ubuntu_apache

  • ii. Spawn a new container using below params:

    • Name: ' myapache'
    • Host port: 81
    • Container port: 80
    • Should run in detach mode
  • iii. Check if apache is accessible on http://<Server_Pubilc_IP>:81 and you see the content of html file you created in step 'b'.