Configuring HTTPD server on Docker Container

I am going to show how to configure a httpd server ( Apache httpd server ) on a centos container and later create an own docker container image.

Step 1 : Starting Docker Engine

No alt text provided for this image

In my case I am using RHEL-8 ( Redhat Enterprise Linux 8 ) Operating system as docker host so I need to run systemctl start docker.

We can verify with the command systemctl status docker to see if the service is started or not.

Step 2 : Launch a Docker Container

No alt text provided for this image

We can use docker ps to check if any container is running , in my case there is no container running. docker images to check which container images are available locally. If you cannot find any local images you can run the following command : docker pull centos.

Step 3 : Install all the necessary packages

No alt text provided for this image

Step 4 : Start the httpd service

No alt text provided for this image

Step 5 : Get the IP address

No alt text provided for this image

Step 6 : Test the Webserver

No alt text provided for this image

Finally we can put our container in background mode and use the command docker commit container_name username/image_name:version to create your own container image.

To view or add a comment, sign in

More articles by Venu Dadi

Insights from the community

Others also viewed

Explore topics