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

Open
#478 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
apache, docker, php, shell

Research direction

Start with the Dockerfile reproducer and compare the behavior before and after yum -y update. Read the referenced /usr/libexec/s2i/assemble, /usr/libexec/s2i/run, and /etc/httpd/conf/httpd.conf entry points; the work is done when the image can update and install packages without causing either reported permission error.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Shell
Stars
114
Forks
326
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sclorg/s2i-php-container

All issues in sclorg/s2i-php-container

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.