From 4f30df52bbed40088081cfd0f3ccb543abcc2dc3 Mon Sep 17 00:00:00 2001 From: Alcides Ramos Date: Sat, 24 Aug 2024 19:00:06 +0200 Subject: [PATCH] build(Dockerfile): clean up working dir when building --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7dea51e..26b19f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,9 @@ RUN addgroup --gid ${HOST_GROUP_ID} ${HOST_GROUP_NAME} \ && adduser --shell /bin/bash --uid ${HOST_USER_ID} --ingroup ${HOST_GROUP_NAME} --ingroup www-data --disabled-password --gecos '' ${HOST_USER_NAME} # Ensure working dir is writtable by current user -RUN chown -Rf ${HOST_USER_NAME}:${HOST_GROUP_NAME} /var/www/html +RUN chown -Rf ${HOST_USER_NAME}:${HOST_GROUP_NAME} /var/www/html \ + && find /var/www/html -type f -delete \ + && rm -Rf /var/www/html/* # Add __ONLY__ compiled extensions & their config files COPY --from=extensions-builder-dev /usr/local/lib/php/extensions/*/* /usr/local/lib/php/extensions/no-debug-non-zts-20230831/