-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 774 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# build stage
FROM alpine:3.23.3 AS builder
ARG UPX_VERSION
ENV LDFLAGS=-static
# download source and compile
RUN apk add --no-cache \
build-base \
cmake \
tar \
wget \
zlib-dev \
xz
RUN wget https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-src.tar.xz -O /upx.tar.xz \
&& tar -xvf /upx.tar.xz -C / \
&& mv /upx-$UPX_VERSION-src /upx
RUN make -C /upx/src release
RUN /upx/build/release/upx \
--lzma \
-o /usr/bin/upx \
/upx/build/release/upx
FROM busybox:1.37.0
ARG BUILD_DATE
LABEL org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.schema-version="1.0"
LABEL org.opencontainers.image.source=https://github.com/sollie/docker-upx
COPY --from=builder /usr/bin/upx /usr/bin/upx
ENTRYPOINT ["/usr/bin/upx"]