mirror of
https://github.com/pcvolkmer/idicon.git
synced 2025-04-19 16:46:50 +00:00
Remove user creation and use UID/GID 8000 to run process
This commit is contained in:
parent
925f4c3f5a
commit
ec33b402b9
16
Dockerfile
16
Dockerfile
@ -1,17 +1,5 @@
|
||||
FROM golang:1.20-alpine AS build-env
|
||||
|
||||
ENV USER=appuser
|
||||
ENV UID=8000
|
||||
|
||||
RUN adduser \
|
||||
--disabled-password \
|
||||
--gecos "" \
|
||||
--home "/null" \
|
||||
--shell "/sbin/nologin" \
|
||||
--no-create-home \
|
||||
--uid "${UID}" \
|
||||
"${USER}"
|
||||
|
||||
WORKDIR /tmp/build
|
||||
ADD . /tmp/build
|
||||
# -ldlflags '-s' to strip binary
|
||||
@ -25,11 +13,9 @@ LABEL org.opencontainers.image.source = "https://github.com/pcvolkmer/idicon"
|
||||
LABEL org.opencontainers.image.licenses="MIT"
|
||||
LABEL org.opencontainers.image.description="Simple identicon service"
|
||||
|
||||
COPY --from=build-env /etc/passwd /etc/passwd
|
||||
COPY --from=build-env /etc/group /etc/group
|
||||
COPY --from=build-env /tmp/build/app /idicon
|
||||
|
||||
USER appuser:appuser
|
||||
USER 8000:8000
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user