Fixed user and group for rootless ubuntu
Build and Push Alpine Image / Build and push image (root-user) (push) Successful in 55s Details
Build and Push Alpine Image / Build and push image (rootless) (push) Successful in 1m0s Details
Build and Push Ubuntu Image / Build and push image (root) (push) Successful in 1m2s Details
Build and Push Ubuntu Image / Build and push image (rootless) (push) Failing after 28s Details

This commit is contained in:
Aditya Prima 2024-09-12 04:08:31 +07:00
parent 2493982ee0
commit 60f75abe09
1 changed files with 3 additions and 3 deletions

View File

@ -7,13 +7,13 @@ LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ENV PHP_FPM_BIN=php-fpm${PHP_VERSION}
# ADD USER
RUN groupadd -g 10001 phpfpm && useradd -M -u 10001 -G phpfpm -s /bin/sh -d /app phpfpm
RUN groupadd -g 10001 phpuser && useradd -M -u 10001 -G phpuser -s /bin/sh -d /app phpuser
# Set workdir
WORKDIR /
# CREATE FUTURE WORKDIR
RUN mkdir -p /app && chown phpfpm:phpfpm /app
RUN mkdir -p /app && chown phpuser:phpuser /app
# INSTALL BASE DEPENDENCIES
RUN --mount=type=cache,target=/var/cache/apt/archives \
@ -40,7 +40,7 @@ RUN apt -y clean
# SET USER WORKDIR
WORKDIR /app
USER phpfpm
USER phpuser
EXPOSE 9000