From d15486a7732c7be1814c0b87f447f07a4710842b Mon Sep 17 00:00:00 2001 From: missuo Date: Sun, 24 May 2026 01:29:43 +0800 Subject: [PATCH] refactor(docker): use Alpine system UID range, reference user by name Drop explicit -u 1000/-g 1000 and let busybox assign from Alpine's system UID range (100-999), aligning with -S (system account) semantics. Reference the account by name in USER and --chown to avoid hard-coding a numeric UID that could collide with future Alpine releases or layered packages. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5acd7fb..7ae590b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o deeplx . FROM alpine:latest WORKDIR /app -RUN addgroup -g 1000 -S deeplx && adduser -h /app -G deeplx -SH -u 1000 deeplx -USER 1000:1000 -COPY --from=builder --chown=deeplx /go/src/github.com/OwO-Network/DeepLX/deeplx /app/deeplx +RUN addgroup -S deeplx && adduser -h /app -G deeplx -SH deeplx +USER deeplx:deeplx +COPY --from=builder --chown=deeplx:deeplx /go/src/github.com/OwO-Network/DeepLX/deeplx /app/deeplx EXPOSE 1188 ENTRYPOINT ["/app/deeplx"]