Skip to content

Commit

Permalink
Fix docker-build script
Browse files Browse the repository at this point in the history
The docker build is layered with a dependencies layer to cache
already compiled dependencies. To not cache the non-dependency code,
the last modified timestamp of the `lib.rs` files has to be updated.

If a new `lib.rs` file is introduced, its timestamp needs to be
updated as well. This was overlooked when introducing the
`canister_sig_utils` crate.

This PR makes the dockerfile more robust to touch _all_ the relevant
`lib.rs` files rather than specific ones.
  • Loading branch information
Frederik Rothenberger committed Oct 30, 2023
1 parent bcf5bfa commit 7b2357f
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 @@ -79,9 +79,7 @@ ARG II_INSECURE_REQUESTS=
# DFX specific metadata for dfx deps
ARG DFX_METADATA=

RUN touch src/internet_identity/src/lib.rs
RUN touch src/internet_identity_interface/src/lib.rs
RUN touch src/canister_tests/src/lib.rs
RUN touch src/*/src/lib.rs
RUN npm ci

RUN ./scripts/build ${DFX_METADATA:+"--dfx-metadata" "$DFX_METADATA"}
Expand All @@ -91,9 +89,7 @@ FROM deps as build_archive

COPY . .

RUN touch src/internet_identity_interface/src/lib.rs
RUN touch src/archive/src/lib.rs
RUN touch src/canister_tests/src/lib.rs
RUN touch src/*/src/lib.rs

RUN ./scripts/build --archive
RUN sha256sum /archive.wasm.gz
Expand Down

0 comments on commit 7b2357f

Please sign in to comment.