mirror of
https://github.com/mgerb/ServerStatus
synced 2026-01-10 03:03:04 +00:00
Make docker image unprivileged
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -9,8 +9,14 @@ RUN make linux
|
||||
|
||||
|
||||
FROM alpine:3.12
|
||||
|
||||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
||||
ARG UNAME="server-status"
|
||||
ARG GNAME="server-status"
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
WORKDIR /server-status
|
||||
COPY --from=0 /go/src/github.com/mgerb/ServerStatus/dist/ServerStatus-linux .
|
||||
ENTRYPOINT ./ServerStatus-linux
|
||||
RUN addgroup -g ${GID} "${GNAME}" && adduser -D -u ${UID} -G "${GNAME}" "${UNAME}" &&\
|
||||
chown "${UNAME}":"${GNAME}" -R /server-status/ &&\
|
||||
apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
||||
USER ${UNAME}
|
||||
|
||||
Reference in New Issue
Block a user