Browse Source

fix: upx compile in stable version

dev
dnomd343 3 years ago
parent
commit
790ada7fe6
  1. 26
      Dockerfile

26
Dockerfile

@ -1,6 +1,6 @@
FROM alpine:3.15 as build
COPY . /tmp/ClearDNS
ENV UPX_VERSION="v3.96"
ENV UPX_VERSION="3.96"
ENV OVERTURE_VERSION="v1.8"
ENV DNSPROXY_VERSION="v0.41.3"
ENV ADGUARD_VERSION="v0.107.5"
@ -8,33 +8,33 @@ RUN \
apk add git build-base bash make cmake glib-dev go npm nodejs yarn perl ucl-dev zlib-dev && \
\
mkdir /tmp/release/ && cd /tmp/ && \
git clone https://github.com/upx/upx.git && \
git clone https://github.com/shawn1m/overture.git && \
git clone https://github.com/AdguardTeam/dnsproxy.git && \
git clone https://github.com/AdguardTeam/AdGuardHome.git && \
wget https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-src.tar.xz && \
\
cd /tmp/upx/ && git checkout $UPX_VERSION && \
git submodule update --init --recursive && \
make all && mv ./src/upx.out /usr/bin/upx && \
cd /tmp/ && tar xf upx-${UPX_VERSION}-src.tar.xz && \
cd upx-${UPX_VERSION}-src && make all && \
mv ./src/upx.out /usr/bin/upx && \
\
cd /tmp/ClearDNS/ && mkdir ./build/ && \
cd ./build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make && \
mv ../bin/cleardns /tmp/release/ && \
\
cd /tmp/overture/ && git checkout $OVERTURE_VERSION && \
env CGO_ENABLED=0 go build -o overture -trimpath -ldflags "-X main.version=$OVERTURE_VERSION -s -w" ./main/main.go && \
cd /tmp/overture/ && git checkout ${OVERTURE_VERSION} && \
env CGO_ENABLED=0 go build -o overture -trimpath -ldflags "-X main.version=${OVERTURE_VERSION} -s -w" ./main/main.go && \
mv ./overture /tmp/release/ && \
\
cd /tmp/dnsproxy/ && git checkout $DNSPROXY_VERSION && \
env CGO_ENABLED=0 go build -trimpath -ldflags "-X main.VersionString=$DNSPROXY_VERSION -s -w" && \
cd /tmp/dnsproxy/ && git checkout ${DNSPROXY_VERSION} && \
env CGO_ENABLED=0 go build -trimpath -ldflags "-X main.VersionString=${DNSPROXY_VERSION} -s -w" && \
mv ./dnsproxy /tmp/release/ && \
\
cd /tmp/AdGuardHome/ && git checkout $ADGUARD_VERSION && \
make VERSION=$ADGUARD_VERSION && \
cd /tmp/AdGuardHome/ && git checkout ${ADGUARD_VERSION} && \
make CHANNEL="release" VERSION=${ADGUARD_VERSION} && \
mv ./AdGuardHome /tmp/release/ && \
\
cd /tmp/release/ && \
strip * && upx -9 *
cd /tmp/release/ && strip cleardns && \
upx -9 AdGuardHome && upx -9 dnsproxy && upx -9 overture
FROM alpine:3.15 as asset
COPY . /tmp/ClearDNS

Loading…
Cancel
Save