Skip to content

Commit

Permalink
Pack binary with upx
Browse files Browse the repository at this point in the history
  • Loading branch information
navrocky committed Jan 20, 2025
1 parent 0b96201 commit 2ed7c0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/dist
/build
/CMakeLists.txt.user
/CMakeUserPresets.json
12 changes: 10 additions & 2 deletions Dockerfile.uclibc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ FROM navrocky/buildroot-uclibc-toolchain:i686-2023.11.1

RUN set -x && \
apt-get update && \
apt-get -y install cmake make python3-pip && \
apt-get -y install --no-install-recommends cmake make python3-pip curl libmpc3 && \
pip install conan --break-system-packages

ENV UPX_VER=4.2.4
RUN set -x && \
curl -LO https://github.com/upx/upx/releases/download/v${UPX_VER}/upx-${UPX_VER}-amd64_linux.tar.xz && \
xzdec upx-${UPX_VER}-amd64_linux.tar.xz | tar xf - && \
install upx-${UPX_VER}-amd64_linux/upx /usr/bin/upx && \
rm -rf upx-${UPX_VER}-amd64_linux upx-${UPX_VER}-amd64_linux.tar.xz

RUN conan profile detect --force && sed -i 's/x86_64/x86/g' ~/.conan2/profiles/default

COPY conanfile.txt /sources/
Expand All @@ -19,4 +26,5 @@ COPY . /sources/
RUN set -x && \
cd /build && \
cmake /sources -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release && \
cmake --build .
cmake --build . && \
upx -9 --brute muenvsubst

0 comments on commit 2ed7c0d

Please sign in to comment.