FROM alpine:edge RUN apk add --no-cache gcc g++ musl-dev libc-dev cmake git samurai coreutils rpm dpkg dpkg-dev xz file RUN mkdir -p /usr/src/yerbacon WORKDIR /usr/src/ ARG BRANCH="devel4" ADD https://api.github.com/repos/upx/upx/git/refs/heads/$BRANCH version.json RUN git clone --quiet -n --branch $BRANCH https://github.com/upx/upx/ ARG CMAKE_BUILD_TYPE="Release" WORKDIR ./upx RUN git checkout --quiet `git tag | sort -V | tail -1` RUN git submodule --quiet update --init RUN mkdir -p ./build/release WORKDIR ./build/release RUN cmake -G Ninja ../.. RUN cmake --build . --parallel `nproc` WORKDIR /usr/src/yerbacon COPY . ./ RUN cmake -G Ninja -S . -B ./cmake-build-release -DCMAKE_EXE_LINKER_FLAGS="-static" -DSELF_PACKER_FOR_EXECUTABLE=/usr/src/upx/build/release/upx RUN cmake --build ./cmake-build-release --parallel `nproc` WORKDIR ./cmake-build-release RUN cpack