Updated nginx rootless dockerfile
Build and Push Alpine NGINX Image to docker.io Registry / Build and push image (root user) (push) Successful in 41s Details
Build and Push Alpine NGINX Image to docker.io Registry / Build and push image (rootless) (push) Successful in 1m8s Details
Build and Push Alpine NodeJS Image to Winter Access Registry / Build and push image (Root User) (push) Successful in 16s Details
Build and Push Alpine NodeJS Image to Winter Access Registry / Build and push image (rootless) (push) Successful in 16s Details

This commit is contained in:
Aditya Prima 2024-08-19 13:28:30 +07:00
parent 6bf314f188
commit 808beb645b
1 changed files with 3 additions and 4 deletions

View File

@ -4,10 +4,8 @@ ARG ALPINE_VERSION=3.20
FROM ${REGISTRY_URL}/alpine:${ALPINE_VERSION} FROM ${REGISTRY_URL}/alpine:${ALPINE_VERSION}
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com" LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
WORKDIR /app
# ADD USER # ADD USER
RUN addgroup -g 10001 nginx && adduser -D -u 10001 -G nginx -s /bin/bash -h /app nginx RUN addgroup -g 10001 nginx && adduser -D -u 10001 -G nginx -s /sbin/nologin -h /app nginx
# INSTALL WGET AND REQUIRED BUILD TOOLS # INSTALL WGET AND REQUIRED BUILD TOOLS
RUN --mount=type=cache,target=/var/cache/apk \ RUN --mount=type=cache,target=/var/cache/apk \
@ -31,8 +29,9 @@ RUN apk del curl && \
# SET AS USER NODE # SET AS USER NODE
WORKDIR /app WORKDIR /app
USER nginx USER nginx
CMD ["nginx"] CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80 EXPOSE 80