@mmumshad@Inderpreet@andrzej@Tej-Singh-Rana
any idea what have gone wrong with my task? its complaining about the required port is not configured to be used by apache2, but I did configured that and the image is build succesfully and I was able to run the image as well. here is the log shows everything:
As per the question below:
create a docker file /opt/docker/Dockerfile (please keep D capital of Dockerfile) on App server 1 in Stratos DC and configure to build an image with the following requirements:
a. Use ubuntu as the base image.
b. Install apache2 and configure it to work on 6400 port. (do not update any other Apache configuration settings like document root etc).
Hello @player001,
yes, as per the second screenshoot, I am able to run the container I built. I think that is a clear verification the container is build and running all good.
I havent tried that to be honest, but as per the requirement of the question, I would assume we are just suppose to manage to build docker image successfully with the requirements they asked for. didn’t even run docker inspect since I was pretty sure what I have done is built with success and I am able to run the container from the image I built.
where is the questions asked me to run the container by the way? otherwise I know if I am suppose to run the container to access to apache I would have to run with -p
create a docker file /opt/docker/Dockerfile (please keep D capital of Dockerfile) on App server 1 in Stratos DC and configure to build an image with the following requirements:
a. Use ubuntu as the base image.
b. Install apache2 and configure it to work on 6400 port. (do not update any other Apache configuration settings like document root etc).
as it cleared form your Dockerfile, the sed command is wrong. Also, in this task , EXPOSE 6400 is not required. After building the image, run the following:
docker run -p hostport:6400 --name=container_name built_image_name
@Devops
1- it says install and configure Apache to work on port 6400, sed sounds to be a requirement thing there.
2- it never says run the container with specific port or at least run the container, the question is clearly asking you to build the the image with these settings. if that is the case, then the question is misleading!
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
So it is required to change /etc/apache2/sites-available/000-default.conf (the one in sites-enabled is just a symlink to this one) to correctly configure the port.
Yes, sed is required but the syntax is not correct which result in getting the error message "apache port is not configured to use port 6400’.
Again, delete EXPOSE 6400 from Dockerfile and correct the sed like: sed -i ‘/s/pattern/replace/g’ /etc/apache2/ports.conf. Build the image and then run a container for testing, and you will access apache from localhost as: curl http://localhost:host_port/.