mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-23 01:54:22 +00:00
Fix config.toml for the docker image
This commit is contained in:
parent
92a2f1bea5
commit
6532748d6c
2 changed files with 21 additions and 15 deletions
|
@ -1,11 +0,0 @@
|
||||||
[net]
|
|
||||||
git-fetch-with-cli = true
|
|
||||||
|
|
||||||
[target.x86_64-unknown-linux-gnu]
|
|
||||||
linker = "x86-64-linux-gnu-gcc"
|
|
||||||
|
|
||||||
[target.aarch64-unknown-linux-gnu]
|
|
||||||
linker = "aarch64-linux-gnu-gcc"
|
|
||||||
|
|
||||||
[target.armv7-unknown-linux-gnueabihf]
|
|
||||||
linker = "arm-linux-gnueabihf-gcc"
|
|
25
Dockerfile
25
Dockerfile
|
@ -1,4 +1,5 @@
|
||||||
FROM --platform=${BUILDPLATFORM} rust:1.68-bullseye AS builder
|
FROM --platform=${BUILDPLATFORM} rust:1.68-bullseye AS builder
|
||||||
|
ARG BUILDPLATFORM
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG RUSTTARGET
|
ARG RUSTTARGET
|
||||||
|
|
||||||
|
@ -6,21 +7,37 @@ RUN apt-get update && \
|
||||||
apt-get upgrade --assume-yes
|
apt-get upgrade --assume-yes
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
if [ ${BUILDPLATFORM} = "linux/amd64" ] || [ ${TARGETPLATFORM} = "linux/amd64" ]; then \
|
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
|
||||||
apt-get install --assume-yes gcc-x86-64-linux-gnu; \
|
apt-get install --assume-yes gcc-x86-64-linux-gnu; \
|
||||||
fi && \
|
fi && \
|
||||||
if [ ${BUILDPLATFORM} = "linux/arm64" ] || [ ${TARGETPLATFORM} = "linux/arm64" ]; then \
|
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
||||||
apt-get install --assume-yes gcc-aarch64-linux-gnu; \
|
apt-get install --assume-yes gcc-aarch64-linux-gnu; \
|
||||||
fi && \
|
fi && \
|
||||||
if [ ${BUILDPLATFORM} = "linux/arm/v7" ] || [ ${TARGETPLATFORM} = "linux/arm/v7" ]; then \
|
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
|
||||||
apt-get install --assume-yes gcc-arm-linux-gnueabihf; \
|
apt-get install --assume-yes gcc-arm-linux-gnueabihf; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
mkdir .cargo && \
|
||||||
|
echo '[net]' >> .cargo/config.toml && \
|
||||||
|
echo 'git-fetch-with-cli = true' >> .cargo/config.toml && \
|
||||||
|
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
|
||||||
|
echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml; \
|
||||||
|
echo 'linker = "x86-64-linux-gnu-gcc"' >> .cargo/config.toml; \
|
||||||
|
fi && \
|
||||||
|
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
||||||
|
echo '[target.aarch64-unknown-linux-gnu]' >> .cargo/config.toml; \
|
||||||
|
echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml; \
|
||||||
|
fi && \
|
||||||
|
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
|
||||||
|
echo '[target.armv7-unknown-linux-gnueabihf]' >> .cargo/config.toml; \
|
||||||
|
echo 'linker = "arm-linux-gnueabihf-gcc"' >> .cargo/config.toml; \
|
||||||
|
fi
|
||||||
|
|
||||||
RUN rustup target add ${RUSTTARGET}
|
RUN rustup target add ${RUSTTARGET}
|
||||||
|
|
||||||
WORKDIR /usr/src/patched_porobot/
|
WORKDIR /usr/src/patched_porobot/
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
RUN mv ./.cargo/config-docker.toml ./.cargo/config.toml
|
|
||||||
|
|
||||||
RUN cargo build --all-features --bins --release --target=${RUSTTARGET}
|
RUN cargo build --all-features --bins --release --target=${RUSTTARGET}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue