Saranya. S
3 min readNov 27, 2020

--

ARTH β€” Task 7 πŸ‘¨πŸ»β€πŸ’»

πŸŒ€ 7.2-A: Docker Task

πŸ”…Configuring HTTPD Server on Docker Container

MAIN STEP : INSTALL CONTAINER ON DOCKER

STEP:1:Install docker in host os

STEP:1.1:open with the directory yum repo

cmd: cd /etc/yum.repos.d

  • create 2 files in it:
  1. vim <filename>.repo :

write the below content in it::

2. vim <filename>.repo:

write the below content in it::

STEP:1.2:Follow the steps below,

  • cd
  • yum repolist
  • yum install docker-ce β€” nobest

#To check: cmd: rpm -q docker-ce

STEP:2:Start the service

cmd: systemctl start docker

To make it permanent in host os i.e.,every time you start the host os use the command,

cmd: systemctl enable docker

To check: docker info [if this cmd run without any error then docker installed successfully]

STEP:3:Launch the container in docker

STEP:3.1:Pull the container

cmd: docker pull <os name>:<version>

To check: docker images

STEP:3.2:Start the container

docker run -it <os name>:<version>

CONFIGURING HTTPD ON TOP OF CONTAINER

#Here container is centos,so configuring apache web server on centos container.

STEP:1:Install the HTTPD

cmd; yum install httpd

[In case if you get any error,stop the firewall in host os,

cmd: systemctl stop firewalld]

To check: rpm -q httpd

STEP:2:Start the service

cmd: systemctl start httpd

STEP:3:Go into the directory /var/www/html

cmd: cd /var/www/html

  • create a file and write something you want to,

CONFIGURING HTTPD ON TOP OF DOCKER CONTAINER!!!

step:4:Final step

To check : <ip>/<filename>.html

COMPLETED!!!

--

--