diff --git a/Dockerfile b/Dockerfile index dd2a835..2e51525 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ ARG ALPINE=3.19 FROM alpine:${ALPINE} ARG PHP +ARG HOST_USER COPY rootfs / RUN apk add --update --no-cache \ + doas \ git \ docker-cli \ php${PHP}-cli \ @@ -34,11 +36,10 @@ RUN apk add --update --no-cache \ php${PHP}-pecl-xdebug \ && ln -sf /usr/bin/php${PHP} /usr/bin/php \ && mv /etc/php/php.ini /etc/php${PHP}/conf.d/zzphp.ini \ - && /usr/local/bin/install-tools -ARG HOST_USER -RUN apk add doas; \ - adduser ${HOST_USER}; \ - echo "${HOST_USER}" | chpasswd; \ - echo "permit ${HOST_USER} as root" > /etc/doas.d/doas.conf + && /usr/local/bin/install-tools \ + && adduser ${HOST_USER} \ + && echo "${HOST_USER}" | chpasswd \ + && echo "permit ${HOST_USER} as root" > /etc/doas.d/doas.conf \ + && stty -onocr ENTRYPOINT [ "/usr/bin/php" ] CMD [ "-v" ] diff --git a/php.ini b/php.ini new file mode 100644 index 0000000..4fdcd22 --- /dev/null +++ b/php.ini @@ -0,0 +1 @@ +sys_temp_dir = /tmp diff --git a/src/docker.sh b/src/docker.sh index d41652e..3c95a51 100644 --- a/src/docker.sh +++ b/src/docker.sh @@ -57,6 +57,7 @@ run() { -v /var/run/docker.sock:/var/run/docker.sock \ -v ~/.gitconfig:/root/.gitconfig:ro \ -v "$(pwd)":/usr/local/src -w /usr/local/src \ + -v "$PHPCTL_DIR/php.ini:/etc/php$PHP_VERSION/conf.d/zphp.ini" \ $phpctl_ini \ $composer_home \ --net host --entrypoint sh \