Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions images/Dockerfile.bottlecap.alpine.compile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ RUN set -euo pipefail && \
curl https://sh.rustup.rs -sSf | \
sh -s -- --profile minimal \
--default-host "${PLATFORM}-unknown-linux-musl" \
--default-toolchain "stable-${PLATFORM}-unknown-linux-musl" \
--component rust-src \
--default-toolchain none \
-y
ENV PATH="${PATH}:/root/.cargo/bin"

Expand Down Expand Up @@ -47,7 +46,7 @@ RUN --mount=type=cache,target=/root/.cargo/git \
# -Ctarget-feature=-crt-static so that it is capable of dynamically loading
# libclang; while still building bottlecap with a static CRT.
RUSTC_WRAPPER=/tmp/dd/.cargo/musl.rustc-wrapper \
cargo +stable build --verbose --locked --no-default-features \
cargo build --verbose --locked --no-default-features \
--features="${FEATURES}" \
--profile="${PROFILE:-release}" && \
mkdir -p /tmp/out && \
Expand Down
5 changes: 2 additions & 3 deletions images/Dockerfile.bottlecap.compile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ RUN chmod +x /install-protoc.sh && /install-protoc.sh
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --profile minimal \
--default-host "${PLATFORM}-unknown-linux-gnu" \
--default-toolchain "stable-${PLATFORM}-unknown-linux-gnu" \
--component rust-src \
--default-toolchain none \
-y
ENV PATH="${PATH}:/root/.cargo/bin"

Expand Down Expand Up @@ -46,7 +45,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/git \
# The `libddwaf` crate links against static objects that require `libclang_rt.builtins`, but
# this is not presented to the linker by default on this platform, so we force it in.
export RUSTFLAGS="${RUSTFLAGS:-} -Clinker=clang -L$(dirname $(clang --print-file-name="libclang_rt.builtins-$(uname -m).a")) -lclang_rt.builtins-$(uname -m)"; \
cargo +stable build --verbose --locked --no-default-features --features="${FEATURES}" ${BUILD_FLAG} && \
cargo build --verbose --locked --no-default-features --features="${FEATURES}" ${BUILD_FLAG} && \
mkdir -p /tmp/out && cp "/tmp/dd/bottlecap/target/${BUILD_MODE}/bottlecap" /tmp/out/bottlecap

# Use smallest image possible
Expand Down
13 changes: 0 additions & 13 deletions images/Dockerfile.build_layer
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ ARG FILE_SUFFIX
# Install dependencies
RUN apt-get update && apt-get install -y zip binutils wget tar xz-utils

# UPX installation directly from GitHub
ENV UPX_VERSION=5.0.0
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
ARCH_NAME="amd64"; \
elif [ "$ARCH" = "aarch64" ]; then \
ARCH_NAME="arm64"; \
fi && \
wget https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${ARCH_NAME}_linux.tar.xz && \
tar -xf upx-${UPX_VERSION}-${ARCH_NAME}_linux.tar.xz && \
mv upx-${UPX_VERSION}-${ARCH_NAME}_linux/upx /usr/local/bin/ && \
rm -rf upx-${UPX_VERSION}-${ARCH_NAME}_linux upx-${UPX_VERSION}-${ARCH_NAME}_linux.tar.xz

RUN mkdir /extensions
WORKDIR /extensions

Expand Down
Loading