1
0
mirror of https://github.com/mgerb/ServerStatus synced 2026-01-09 02:52:47 +00:00

Make docker image unprivileged

This commit is contained in:
Ethorbit
2024-03-02 17:15:02 -08:00
committed by Mitchell Gerber
parent 50a06b98be
commit e4320bcecb
2 changed files with 12 additions and 2 deletions

View File

@@ -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}

View File

@@ -3,5 +3,9 @@ version: "3"
services:
server-status:
image: mgerb/server-status:latest
build:
args:
UID: 1000
GID: 1000
volumes:
- ./config.json:/server-status/config.json