Skip to content

Commit

Permalink
Simplify dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
bitdivine committed Jan 21, 2025
1 parent 12aca24 commit a396f64
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# dfx temporary files
.dfx/

# rust and downloaded wasm|did files
target/

# frontend code
node_modules/
build/
Expand All @@ -25,4 +28,4 @@ internet_identity.did

codes.txt

backend-v*.wasm.gz
backend-v*.wasm.gz
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ bitcoin*.gz
# rust and downloaded wasm|did files
target/

# files used by docker buildx
in/

# files created by docker buildx
out/

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ COPY scripts/build.report.sh scripts/
# The Wasm build is slow and typically cached:
RUN scripts/build.backend.wasm.sh
# Commit will change even with unrelated changes, so is afetr the rust build:
COPY ./target/tags target/tags
COPY ./target/commit target/commit
COPY ./in/tags in/tags
COPY ./in/commit in/commit
# The network may be overridden with arguments to the docker call: --env DFX_NETWORK=whatever
# Note: The rust is re-built but that is fast.
ENV DFX_NETWORK=ic
Expand Down
6 changes: 3 additions & 3 deletions scripts/build.backend.metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ CANDID_FILE="$(jq -r ".canisters.$CANISTER.candid" dfx.json)"
ARGS_FILE="$(jq -r ".canisters.$CANISTER.init_arg_file" dfx.json)"
WASM_FILE="$(jq -r ".canisters.$CANISTER.wasm" dfx.json)"
BUILD_DIR="target/wasm32-unknown-unknown/release"
COMMIT_FILE="target/commit"
TAGS_FILE="target/tags"
COMMIT_FILE="in/commit"
TAGS_FILE="in/tags"

####
# Gets commit and tag information, if available.
mkdir -p target
mkdir -p in
if test -d .git; then
scripts/commit-metadata
else
Expand Down
6 changes: 3 additions & 3 deletions scripts/commit-metadata
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
: The commit and any tags.

mkdir -p tags
git rev-parse HEAD >target/commit
git tag -l --contains HEAD >target/tags
mkdir -p in
git rev-parse HEAD >in/commit
git tag -l --contains HEAD >in/tags

0 comments on commit a396f64

Please sign in to comment.