Apache dockerffile

Create Apache Docker Image Using Dockerfile

Create an apache docker image using dockerfile, Docker’s now most widely used container virtualization. It helps us to decrease IT cost and we can run multiple containers in a single Operating System. you can also create apache dockerfile in centos.

We can also create an apache container using the command line and also with images. you can write all the packages that requires to create an image and later you can use to create more containers using this image. It will save you time.

When you’re going to have a container then you must attach the data volume. 

Check Out: Create A Container

I will show you how to create a container of Apache using the Docker file. The recommended way is to create Docker Images that create a directory and keep your files there.

mkdir apache

cd /apache

vim dockerfile

Create Apache Docker Image

docker build -t dockerfile .

Check Out: Backup of a Container

The image has been built.

create apache docker

Now you need to create an Apache container using the Centos-Apache image.

docker run -itd –name apachecon -p 147:80 1e1148e4cc2c /bin/bash

apache dockerfile centos

Access the container using docker attach 231cac0c66235f

create apache dockerfile

Check Out: Monitor Health of a Container

The next step is to check the website running in a docker container from outside.

example: http:

You’re done apache dockerfile centos

Leave a Reply

Notify of