Add UPX executable compression to Docker build in order to reduce binary and docker image sizes significantly
This commit is contained in:
parent
d5fa1ffd7a
commit
84c49319a6
@ -1,10 +1,18 @@
|
|||||||
FROM alpine:3.17.0
|
FROM alpine:3.17.0 as builder
|
||||||
|
|
||||||
|
RUN apk add --no-cache upx
|
||||||
|
ADD ./bin/Purr-musl /app/Purr-musl
|
||||||
|
|
||||||
|
RUN upx /app/Purr-musl -o /app/Purr-musl-upx
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD ./views /app/views
|
ADD ./views /app/views
|
||||||
ADD ./src /app/src
|
ADD ./src /app/src
|
||||||
ADD ./bin/Purr-musl /app/Purr-musl
|
|
||||||
|
COPY --from=builder /app/Purr-musl-upx /app/Purr
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENTRYPOINT ["/app/Purr-musl"]
|
ENTRYPOINT ["/app/Purr"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user