Skip to content

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

Open
@Jubast

Description

@Jubast

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions