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 && \
|
RUN mkdir ./bin && \
|
||||||
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
|
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
|
||||||
mkdir ./bin/etc && \
|
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 "appuser:x:$ID:$ID::/sbin/nologin:/bin/false" > ./bin/etc/passwd && \
|
||||||
echo "appgroup:x:$ID:appuser" > ./bin/etc/group
|
echo "appgroup:x:$ID:appuser" > ./bin/etc/group
|
||||||
|
|
||||||
|
@ -15,3 +16,4 @@ WORKDIR /
|
||||||
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
|
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
|
||||||
USER appuser
|
USER appuser
|
||||||
ENTRYPOINT ["/goStatic"]
|
ENTRYPOINT ["/goStatic"]
|
||||||
|
|
Loading…
Reference in a new issue