FIX: 'RANDOM' not available in golang image, using 'shuf' instead.
This commit is contained in:
parent
b3734e9ff9
commit
607878c71a
1 changed files with 3 additions and 1 deletions
|
@ -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"]
|
||||
|
Loading…
Reference in a new issue