From 245f1dad389ca60ff820d169012d0f3dcc7e70a9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 12 Jul 2024 06:45:08 +0200 Subject: [PATCH] =?UTF-8?q?jk:=20Sacrifice=20packages=20to=20the=20Debian?= =?UTF-8?q?=20bookworm=20d=C3=A6mons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec999020..3bc3c3f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN \ if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ dpkg --add-architecture amd64; \ apt-get update; \ - apt-get install --assume-yes gcc-x86-64-linux-gnu x86-64-linux-gnu-pkg-config; \ + apt-get install --assume-yes gcc-x86-64-linux-gnu; \ echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml; \ echo 'linker = "x86-64-linux-gnu-gcc"' >> .cargo/config.toml; \ echo >> .cargo/config.toml; \ @@ -24,7 +24,7 @@ RUN \ if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ dpkg --add-architecture arm64; \ apt-get update; \ - apt-get install --assume-yes gcc-aarch64-linux-gnu aarch64-linux-gnu-pkg-config; \ + apt-get install --assume-yes gcc-aarch64-linux-gnu; \ echo '[target.aarch64-unknown-linux-gnu]' >> .cargo/config.toml; \ echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml; \ echo >> .cargo/config.toml; \ @@ -32,7 +32,7 @@ RUN \ if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ dpkg --add-architecture armhf; \ apt-get update; \ - apt-get install --assume-yes gcc-arm-linux-gnueabihf arm-linux-gnueabihf-pkg-config; \ + apt-get install --assume-yes gcc-arm-linux-gnueabihf; \ echo '[target.armv7-unknown-linux-gnueabihf]' >> .cargo/config.toml; \ echo 'linker = "arm-linux-gnueabihf-gcc"' >> .cargo/config.toml; \ echo >> .cargo/config.toml; \ @@ -53,11 +53,11 @@ RUN \ RUN \ if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ - apt-get install --assume-yes libpq5:amd64 libpq-dev:amd64 openssl:amd64 libssl-dev:amd64; \ + apt-get install --assume-yes libpq5:amd64 libpq-dev:amd64 openssl:amd64 libssl-dev:amd64 pkg-config:amd64; \ elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ - apt-get install --assume-yes libpq5:arm64 libpq-dev:arm64 openssl:arm64 libssl-dev:arm64; \ + apt-get install --assume-yes libpq5:arm64 libpq-dev:arm64 openssl:arm64 libssl-dev:arm64 pkg-config:arm64; \ elif [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ - apt-get install --assume-yes libpq5:armhf libpq-dev:armhf openssl:armhf libssl-dev:armhf; \ + apt-get install --assume-yes libpq5:armhf libpq-dev:armhf openssl:armhf libssl-dev:armhf pkg-config:armhf; \ fi COPY ./ ./ @@ -68,14 +68,20 @@ RUN \ RUSTTARGET=x86_64-unknown-linux-gnu; \ export TARGET_CC=/usr/bin/x86-64-linux-gnu-gcc; \ export TARGET_AR=/usr/bin/x86-64-linux-gnu-ar; \ + export HOST_PKG_CONFIG_PATH=/; \ + export TARGET_PKG_CONFIG_PATH=/usr/x86-64-linux-gnu; \ elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ RUSTTARGET=aarch64-unknown-linux-gnu; \ export TARGET_CC=/usr/bin/aarch64-linux-gnu-gcc; \ export TARGET_AR=/usr/bin/aarch64-linux-gnu-ar; \ + export HOST_PKG_CONFIG_PATH=/; \ + export TARGET_PKG_CONFIG_PATH=/usr/aarch64-linux-gnu; \ elif [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ RUSTTARGET=armv7-unknown-linux-gnueabihf; \ export TARGET_CC=/usr/bin/arm-linux-gnueabihf-gcc; \ export TARGET_AR=/usr/bin/arm-linux-gnueabihf-ar; \ + export HOST_PKG_CONFIG_PATH=/; \ + export TARGET_PKG_CONFIG_PATH=/usr/arm-linux-gnueabihf; \ fi && \ cargo build --all-features --bins --release --target=${RUSTTARGET}