Write a Docker File task marked failed

Thanks, I really appreciate it.

Do not forget to start apache2 :slight_smile: this is as well missing

Sure, will do @andrzej:sweat_smile:

@Ayman @Inderpreet

can you take a look why my configuration failed?

image

/opt/docker/Dockerfile

FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y
RUN apt-get install apache2 -y
RUN sed -i ‘s/80/3003/’ /etc/apache2/ports.conf
EXPOSE 3003

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

Have you tested with curl command?

Because in your dockerfile double quotes is not okay. A few is a block quotes.

curl command shows good

https://www.reddit.com/r/docker/comments/9wn5gw/be_aware_of_the_quotes_in_your_dockerfile/

this link said single quote not ok, has to be double quote for avoiding debugging nightmare :frowning:

I am not again double quotes, In your mention dockerfile a few double quotes looks like block quotes.

I have enrolled @mmumshad several course on Udemy, except the docker course, but from the course detail, no docker file section. :frowning: in the Kubernetes course, he briefly touched on docker. Anyone point me to where can i get some info for dockerfile format?

@Tej-Singh-Rana thank you for your help. just lately a little frustrated on failing tasks and unsure the reason. and didn’t find out what went wrong. I was sure that I solve the problems then submit, but FAILED jumped at you, don’t feel good. :slightly_frowning_face:

for the action RUN sed -i ‘s/80/3003/’ /etc/apache2/ports.conf I guess that you have to install sed, I’m not sure

And now I’m sure
Step 5/8 : RUN sed -i ‘s/80/3003/’ /etc/apache2/ports.conf
—> Running in 9d6411dab3f1
sed: -e expression #1, char 1: unknown command: `�’
The command ‘/bin/sh -c sed -i ‘s/80/3003/’ /etc/apache2/ports.conf’ returned a non-zero code: 1

1 Like

First: remove EXPOSE 3003
Second: sed command is not correct

@Jenna, the best place where you can learn about dockerfile is in the official docs Dockerfile reference | Docker Docs
You can read/hear/see another materials, and I truly encourage you to do so, but to have a deeper understanding you need to go to the sources.

thank you @francilio

what is the correct sed command?

The syntax is sed -i ‘s/pattern/replace/g’ /ec/apache2/ports.conf

thank you @Devops :innocent: :innocent:

FROM ubuntu
RUN apt-get update -y
RUN apt-get install apache2 -y
RUN sed -i ‘s/80/6000/’ /etc/apache2/ports.conf
ENTRYPOINT [“/usr/sbin/apache2ctl”]
CMD [“-D”, “FOREGROUND”, “-k”, “start”]

While installing Apache2 i got struck in below point. Even if i gave area it is not moving forward. Kindly let me know what mistake i am doing

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
  2. America 5. Arctic 8. Europe 11. SystemV
  3. Antarctica 6. Asia 9. Indian 12. US
    Geographic area: 9