mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-22 02:54:21 +00:00
Improve Docker build caching
This commit is contained in:
parent
adca9ba0ee
commit
d2a7831d4c
1 changed files with 12 additions and 0 deletions
12
Dockerfile
12
Dockerfile
|
@ -60,6 +60,18 @@ RUN \
|
||||||
apt-get install --assume-yes libpq-dev:armhf; \
|
apt-get install --assume-yes libpq-dev:armhf; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
COPY ./Cargo.toml ./Cargo.toml
|
||||||
|
COPY ./Cargo.lock ./Cargo.lock
|
||||||
|
RUN \
|
||||||
|
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
|
||||||
|
RUSTTARGET=x86_64-unknown-linux-gnu; \
|
||||||
|
elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
||||||
|
RUSTTARGET=aarch64-unknown-linux-gnu; \
|
||||||
|
elif [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
|
||||||
|
RUSTTARGET=armv7-unknown-linux-gnueabihf; \
|
||||||
|
fi && \
|
||||||
|
cargo fetch --locked --target=${RUSTTARGET}
|
||||||
|
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
|
|
||||||
# This has reached a new level of hack
|
# This has reached a new level of hack
|
||||||
|
|
Loading…
Reference in a new issue