Write a Dockerfile task

FROM ubuntu

RUN apt-get update
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get install -y apache2

RUN sed -i “s/80/8083/g” /etc/apache2/ports.conf

ENTRYPOINT [“/usr/sbin/apache2ctl”, “-D”, “FOREGROUND”]

1 Like

I ran with -d option to run in the background but don’t know why task got failed. Result said you haven’t use apache but in the task description to use apache2.

Please try again now, also do not use double quotes (use single quotes instead) with sed command within Dockerfile.

Okay, let me try this.

I did this task(write a Dockerfile) correctly but the error was occur, I don’t know why. Please check and let me know.
Please find the screenshot.

@Inderpreet @kodekloud-support3
Hello,
My task failed and I do not see why. Can you please check?
I did everything as mentioned in the forums:

screenshot

Hello, @nenadmiladin
You haven’t exposed the newly changed port.
keyword is EXPOSE

@Inderpreet @kodekloud-support3
I have read in multiple threads that EXPOSE is not required.
Example:

What I actually forgot to do is run the container with the new image. I checked it on a different system where it worked. I suppose that’s the reason my task got failed. But then again it is not said that the container needs to be in a running state so that the system can check the task.

They could’ve check the image itself with docker image inspect

The task instruction should be updated with at least a note that we also need to have a running container with the new image, a lot of people with fail the task unnecessarily.

Can you share image of the question? I don’t have.

As per recent requirements shared by the Nautilus application development team, they need custom images created for one of their projects. Several of the initial testing requirements are already been shared with DevOps team. Therefore, create a docker file /opt/docker/Dockerfile (please keep D capital of Dockerfile) on App server 3 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 8086 port. (do not update any other Apache configuration settings like document root etc).

Have you copied this from somewhere? Actually port is not matching.

I am sorry, I started the task multiple times, the one I actually did was with port 3004.

Okay, you treated well according to ask. but have you tested with the curl command ? Is it listening in the mentioned port?

No, I did not run a container and did not do port mapping because it is not said in the task that we need a running container.

But at least we have to check, it will work or not. Same scenario in the real world as well. Without testing or verify we cannot deploy in the production. That’s quite risky.

1 Like

Anyways KKE team will look into this. I am giving my best to assist you.

Thank you very much for the input, I think that you are right and that I should have tested it out on a running container.

@nenadmiladin This can be marked Success for you, could you please let us know if you have you today’s task assigned already ?

@Inderpreet
Yes I have, it’s Ansible Facts Gathering

@nenadmiladin This is marked Success for you.

1 Like