Files
tuwunel/docker/Dockerfile.install
Jason Volk deb5c65885 docker: Add conditions to set assert_linkage for Dockerfile.install
ci: Check packages when using test branch.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-11-23 03:36:17 +00:00

32 lines
778 B
Docker

# syntax = docker/dockerfile:1.11-labs
FROM input AS install
ARG rust_target
ARG CARGO_TARGET_DIR
ARG cargo_target_profile
ARG install_prefix
ARG assert_linkage=""
WORKDIR /
COPY --link --from=input . .
WORKDIR ${install_prefix}
ENV src_path="${CARGO_TARGET_DIR}/${rust_target}/${cargo_target_profile}/tuwunel"
ENV dst_path="${install_prefix}/bin/tuwunel"
COPY --from=bins $src_path $dst_path
RUN <<EOF
ldd -v "${dst_path}"
ret=$?
if [ "$ret" = "0" ] && [ "$assert_linkage" = "static" ]; then
echo "($ret) expected a static binary"
exit 1
elif [ "$ret" != "0" ] && [ "$assert_linkage" = "dynamic" ]; then
echo "($ret) expected a dynamic binary"
exit 1
fi
set -eux
du -h "${dst_path}"
sha1sum "${dst_path}"
EOF