This commit is contained in:
PRIHLOP 2022-03-08 18:19:23 +00:00 committed by GitHub
commit 5882ec07d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,16 +18,16 @@ RUN mkdir ./bin && \
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build ${BUILD_ARGS} -ldflags="-s" -tags netgo -installsuffix netgo -o ./bin/goStatic && \ CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build ${BUILD_ARGS} -ldflags="-s" -tags netgo -installsuffix netgo -o ./bin/goStatic && \
mkdir ./bin/etc && \ mkdir ./bin/etc && \
ID=$(shuf -i 100-9999 -n 1) && \ ID=65534 && \
upx -9 ./bin/goStatic && \ upx -9 ./bin/goStatic && \
echo $ID && \ echo $ID && \
echo "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \ echo "gostatic:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \
echo "appgroup:x:$ID:appuser" > ./bin/etc/group echo "gostatic:x:$ID:gostatic" > ./bin/etc/group
# stage 1 # stage 1
FROM scratch FROM scratch
WORKDIR / WORKDIR /
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ . COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
USER appuser USER gostatic
ENTRYPOINT ["/goStatic"] ENTRYPOINT ["/goStatic"]