Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performing a yum -y update before installing additional packages breaks httpd #478

Open
Jubast opened this issue Jan 30, 2025 · 0 comments

Comments

@Jubast
Copy link

Jubast commented Jan 30, 2025

Container platform

Podman/Docker

Version

registry.access.redhat.com/ubi9/php-81:9.5

OS version of the container image

el9

Bugzilla, Jira

No response

Description

Performing a yum -y update before installing additional packages breaks httpd

Issues:
1.) Permissions error when updating httpd.conf

STEP 9/10: RUN sed -i "s/^Listen 0.0.0.0:8080/Listen 0.0.0.0:8081/" /etc/httpd/conf/httpd.conf
sed: couldn't open temporary file /etc/httpd/conf/sedTWjtCG: Permission denied
Error: building at STEP "RUN sed -i "s/^Listen 0.0.0.0:8080/Listen 0.0.0.0:8081/" /etc/httpd/conf/httpd.conf": while running runtime: exit status 4

2.) Permission error when starting the container /usr/libexec/s2i/run (at httpd -D FOREGROUND)

(13)Permission denied: AH00058: Error retrieving pid file run/httpd.pid
AH00059: Remove it before continuing if it is corrupted.

Workaround:
omit yum -y update command

Reproducer

1.)
Dockerfile ->

FROM registry.access.redhat.com/ubi9/php-81:9.5

USER 0
RUN yum -y update && \
    yum -y install git && \
    yum clean all
USER 1001

RUN mkdir -p /tmp/src/public
RUN echo '<?php\n\necho "Hello World!";\n' > /tmp/src/public/index.php

ENV DOCUMENTROOT=/public

RUN /usr/libexec/s2i/assemble
# permission error here
RUN sed -i "s/^Listen 0.0.0.0:8080/Listen 0.0.0.0:8081/" /etc/httpd/conf/httpd.conf

CMD /usr/libexec/s2i/run

bash ->

podman build -t test -f Dockerfile .
..
...
STEP 9/10: RUN sed -i "s/^Listen 0.0.0.0:8080/Listen 0.0.0.0:8081/" /etc/httpd/conf/httpd.conf
sed: couldn't open temporary file /etc/httpd/conf/sedTWjtCG: Permission denied
Error: building at STEP "RUN sed -i "s/^Listen 0.0.0.0:8080/Listen 0.0.0.0:8081/" /etc/httpd/conf/httpd.conf": while running runtime: exit status 4

2.)
Dockerfile ->

FROM registry.access.redhat.com/ubi9/php-81:9.5

USER 0
RUN yum -y update && \
    yum -y install git && \
    yum clean all
USER 1001

RUN mkdir -p /tmp/src/public
RUN echo '<?php\n\necho "Hello World!";\n' > /tmp/src/public/index.php

ENV DOCUMENTROOT=/public

RUN /usr/libexec/s2i/assemble

# run error
CMD /usr/libexec/s2i/run

bash ->

podman build -t test .
podman run test
..
...
(13)Permission denied: AH00058: Error retrieving pid file run/httpd.pid
AH00059: Remove it before continuing if it is corrupted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant