Dockerfile with ubuntu and apache2

Hi Team,

I have tried to create a Dockerfile with Ubuntu as base image and apache2. Check has been failed with below error:

- As per '/opt/docker/Dockerfile' on App Server 1 apache is not configured to use port '8082'
FAILED dockerfile.py::test_docker_dockerfile - AssertionError: - As per '/opt...

I have exposed the port 8082. Please find attached the screenshot of Dockerfile and error. Request your valuable help and support

Regards,
Srikanth

Simply putting EXPOSE 8082 does not mean that the apache server is accepting requests on that port - it isn’t - it’s still listening on port 80!

The dockerfile needs to use sed on the appropriate .conf files that were installed by apt to change the port number from 80 to the requested port before apache is started.

3 Likes

Hi @Alistair_KodeKloud,
Thank you for your valuable help. I’m able to resolve the issue.
Regards,
Srikanth