From 8f1e81484c805828311a1b60e1796b83c6ad66f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Mon, 5 Feb 2018 10:09:17 +0100 Subject: [PATCH] Fix permissions to invoke Yum --- Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ba26f47..df060c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,7 @@ FROM registry.access.redhat.com/rhscl/httpd-24-rhel7:latest -# CGI scripts go to /opt/rh/httpd24/root/var/www/cgi-bin/ -ADD share/cgi-bin /opt/rh/httpd24/root/var/www/cgi-bin/ - -# Static files go to /opt/rh/httpd24/root/var/www/html -ADD share/html /opt/rh/httpd24/root/var/www/html +# YUM requires root +USER 0 # Install missing Perl modules RUN yum update -y \ @@ -12,3 +9,12 @@ RUN yum update -y \ && yum clean all \ && rm -rf /var/cache/yum +# Back to unprivileged user +USER 1001 + +# CGI scripts go to /opt/rh/httpd24/root/var/www/cgi-bin/ +ADD share/cgi-bin ${HTTPD_DATA_ORIG_PATH}/cgi-bin/ + +# Static files go to /opt/rh/httpd24/root/var/www/html +ADD share/html ${HTTPD_DATA_ORIG_PATH}/html +