From 103265a6e317b6c0eb95e92c45806f4e1faadf62 Mon Sep 17 00:00:00 2001 From: leocavalcante Date: Fri, 9 Feb 2024 09:35:18 -0300 Subject: [PATCH 1/3] feat: Always add a INI file --- php.ini | 1 + src/docker.sh | 1 + 2 files changed, 2 insertions(+) create mode 100644 php.ini 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 \ From 2d3b7b67d8ba92981f747e152c29f64ee36cd151 Mon Sep 17 00:00:00 2001 From: leocavalcante Date: Fri, 9 Feb 2024 11:06:34 -0300 Subject: [PATCH 2/3] refactor: Do not print carriage returns in the first column --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd2a835..151fe35 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} \ + && "${HOST_USER}" | chpasswd \ + && echo "permit ${HOST_USER} as root" > /etc/doas.d/doas.conf \ + && stty -onocr ENTRYPOINT [ "/usr/bin/php" ] CMD [ "-v" ] From a5b2bcaf8b92753192ba5c7db3ff4505c300fd83 Mon Sep 17 00:00:00 2001 From: leocavalcante Date: Fri, 9 Feb 2024 11:09:40 -0300 Subject: [PATCH 3/3] fix: User --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 151fe35..2e51525 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN apk add --update --no-cache \ && mv /etc/php/php.ini /etc/php${PHP}/conf.d/zzphp.ini \ && /usr/local/bin/install-tools \ && adduser ${HOST_USER} \ - && "${HOST_USER}" | chpasswd \ + && echo "${HOST_USER}" | chpasswd \ && echo "permit ${HOST_USER} as root" > /etc/doas.d/doas.conf \ && stty -onocr ENTRYPOINT [ "/usr/bin/php" ]