Skip to content
Snippets Groups Projects
Commit 14c20720 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

wip add cache to dockerfile

parent f56ea6c3
No related branches found
No related tags found
No related merge requests found
Pipeline #36350 waiting for manual action
...@@ -21,7 +21,8 @@ WORKDIR /root ...@@ -21,7 +21,8 @@ WORKDIR /root
# Copy source tree # Copy source tree
COPY . . COPY . .
RUN apt-get update && \ RUN --mount=type=cache,target=/var/cache/apt &&
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y clang cmake protobuf-compiler DEBIAN_FRONTEND=noninteractive apt-get install -y clang cmake protobuf-compiler
# build duniter # build duniter
...@@ -34,7 +35,7 @@ RUN if [ "$debug" = 0 ]; then \ ...@@ -34,7 +35,7 @@ RUN if [ "$debug" = 0 ]; then \
fi fi
# Configure cross-build environment if need be # Configure cross-build environment if need be
RUN set -x && \ RUN --mount=type=cache,target=/var/cache/apt && set -x && \
if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \ if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \
. /root/dynenv && \ . /root/dynenv && \
apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \ apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \
...@@ -45,7 +46,7 @@ RUN set -x && \ ...@@ -45,7 +46,7 @@ RUN set -x && \
# Build # Build
ARG chain="gdev" ARG chain="gdev"
RUN set -x && \ RUN --mount=type=cache,target=build && set -x && \
cat /root/dynenv && \ cat /root/dynenv && \
. /root/dynenv && \ . /root/dynenv && \
cargo build --locked $CARGO_OPTIONS --no-default-features $BENCH_OPTIONS --features $chain --target "$RUST_ARCH_TRIPLET" && \ cargo build --locked $CARGO_OPTIONS --no-default-features $BENCH_OPTIONS --features $chain --target "$RUST_ARCH_TRIPLET" && \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment