Skip to content

Commit

Permalink
Make build-cache to image, not local
Browse files Browse the repository at this point in the history
  • Loading branch information
sinoru committed Feb 2, 2024
1 parent 7ebefe8 commit 89ad3e7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ WORKDIR /opt/aode-relay

ADD Cargo.lock Cargo.toml .cargo /opt/aode-relay/
RUN \
--mount=type=cache,id=$BUILDPLATFORM:/opt/aode-relay/target,target=/opt/aode-relay/target \
--mount=type=cache,id=$BUILDPLATFORM:/root/.cargo,target=/root/.cargo \
cargo fetch;

ADD . /opt/aode-relay

RUN \
--mount=type=cache,id=$BUILDPLATFORM:/opt/aode-relay/target,target=/opt/aode-relay/target \
--mount=type=cache,id=$BUILDPLATFORM:/root/.cargo,target=/root/.cargo \
set -eux; \
cargo build --frozen --release; \
mkdir -p bin; \
cp -afL target/release/relay bin/aode-relay;
cargo build --frozen --release;

################################################################################

Expand All @@ -41,7 +37,7 @@ RUN \
set -eux; \
apk add -U ca-certificates curl tini;

COPY --link --from=builder /opt/aode-relay/bin/aode-relay /usr/local/bin/aode-relay
COPY --link --from=builder /opt/aode-relay/target/release/relay /usr/local/bin/aode-relay

# Smoke test
RUN /usr/local/bin/aode-relay --help
Expand Down

0 comments on commit 89ad3e7

Please sign in to comment.