Merge 1bd22e6dff
into 72ed8fa4a9
This commit is contained in:
commit
5882ec07d0
1 changed files with 4 additions and 4 deletions
|
@ -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"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue