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
|
FROM alpine:3.12
|
||||||
|
ARG UNAME="server-status"
|
||||||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
ARG GNAME="server-status"
|
||||||
|
ARG UID=1000
|
||||||
|
ARG GID=1000
|
||||||
WORKDIR /server-status
|
WORKDIR /server-status
|
||||||
COPY --from=0 /go/src/github.com/mgerb/ServerStatus/dist/ServerStatus-linux .
|
COPY --from=0 /go/src/github.com/mgerb/ServerStatus/dist/ServerStatus-linux .
|
||||||
ENTRYPOINT ./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:
|
services:
|
||||||
server-status:
|
server-status:
|
||||||
image: mgerb/server-status:latest
|
image: mgerb/server-status:latest
|
||||||
|
build:
|
||||||
|
args:
|
||||||
|
UID: 1000
|
||||||
|
GID: 1000
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/server-status/config.json
|
- ./config.json:/server-status/config.json
|
||||||
|
|||||||
Reference in New Issue
Block a user