From af9921f4fbec91983d7d4d6fab629db1b836186e Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Mon, 13 Jan 2020 18:31:26 +0100 Subject: [PATCH] Fixed broken Dockerfile and docker-startup.sh Signed-off-by: Marco Dickert --- Dockerfile | 6 +++--- docker-startup.sh | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 48cc3af..451e536 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ ENV IFM_ROOT_DIR="/var/www" \ IFM_TMP_DIR="/tmp" # add missing extensions and dependencies -RUN apk add --no-cache libbz2 libzip libcap - apk add --no-cache --virtual .php-extension-build-deps bzip2 bzip2-dev libzip-dev - docker-php-ext-install bz2 zip +RUN apk add --no-cache libbz2 libzip libcap sudo && \ + apk add --no-cache --virtual .php-extension-build-deps bzip2 bzip2-dev libzip-dev && \ + docker-php-ext-install bz2 zip && \ apk del --no-cache --purge .php-extension-build-deps # allow php binary to bind ports <1000, even if $USER != root diff --git a/docker-startup.sh b/docker-startup.sh index fe8c57f..983e468 100755 --- a/docker-startup.sh +++ b/docker-startup.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -xe if [ ! -z $IFM_DOCKER_UID ]; then if [ -z $IFM_DOCKER_GID ]; then @@ -15,8 +15,13 @@ if [ ! -z $IFM_DOCKER_UID ]; then REAL_GROUP=$(getent group $IFM_DOCKER_GID | sed "s/:.*//") fi adduser -u $IFM_DOCKER_UID -HDG $REAL_GROUP ifm + sudo -E -u ifm -c "php -S 0:80 -t /usr/local/share/webapps/ifm" else - adduser -HD ifm + deluser xfs + deluser www-data + addgroup -g 33 -S www-data + adduser -SHD -u 33 -G www-data www-data + getent passwd + sudo -E -u www-data php -S 0:80 -t /usr/local/share/webapps/ifm fi -su ifm -c "php -S 0:80 -t /usr/local/share/webapps/ifm"