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:
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}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user