do not install upx

This commit is contained in:
Tom Shortall 2023-11-14 11:05:06 +00:00
parent 72ed8fa4a9
commit e7a4d1baf4

View file

@ -7,19 +7,14 @@ WORKDIR /go/src/github.com/PierreZ/goStatic
COPY . . COPY . .
RUN mkdir ./bin && \ RUN mkdir ./bin && \
apt-get update && apt-get install -y upx && \
# getting right vars from docker buildx # getting right vars from docker buildx
# especially to handle linux/arm/v6 for example # especially to handle linux/arm/v6 for example
GOOS=$(echo $TARGETPLATFORM | cut -f1 -d/) && \ GOOS=$(echo $TARGETPLATFORM | cut -f1 -d/) && \
GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d/) && \ GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d/) && \
GOARM=$(echo $TARGETPLATFORM | cut -f3 -d/ | sed "s/v//" ) && \ GOARM=$(echo $TARGETPLATFORM | cut -f3 -d/ | sed "s/v//" ) && \
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=$(shuf -i 100-9999 -n 1) && \
upx -9 ./bin/goStatic && \
echo $ID && \ 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