Write a Docker File task marked failed

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

Actually, the source image ubuntu does not have timezone set I believe. you have to inject this in your docker file.

Hello, @nithyaks
You have to inject the ENV instruction and assign it DEBIAN_FRONTEND=noninteractive

ENV DEBIAN_FRONTEND=noninteractive
1 Like