From 607878c71a8511bd23dbb8b4d7e77735f1165fb1 Mon Sep 17 00:00:00 2001 From: mason Date: Mon, 11 Nov 2019 16:25:34 -0800 Subject: [PATCH] FIX: 'RANDOM' not available in golang image, using 'shuf' instead. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a0927cc..c488369 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ COPY . . RUN mkdir ./bin && \ CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \ mkdir ./bin/etc && \ - UI=$(( ( RANDOM % 9999 ) + 99 )) && \ + ID=$(shuf -i 100-9999 -n 1) && \ + echo $ID && \ echo "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \ echo "appgroup:x:$ID:appuser" > ./bin/etc/group @@ -15,3 +16,4 @@ WORKDIR / COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ . USER appuser ENTRYPOINT ["/goStatic"] + \ No newline at end of file