Skip to content

Commit

Permalink
Include the git commit hash in Docker images
Browse files Browse the repository at this point in the history
Send to the Docker build daemon the necessary files from the `.git`
directory so that the build scripts can extract the hash of the HEAD
commit.
  • Loading branch information
andiflabs committed Jul 8, 2024
1 parent a8c8c51 commit 2c1b273
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ironfish-cli/scripts/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ set -euo pipefail
cd "$(dirname "$0")/../.."

cat .gitignore - > .dockerignore <<EOF
# do not send the .git directory to the Docker daemon to make builds faster
# Do not send all the files from the .git directory to the Docker daemon to
# make builds faster. Send only the strictly necessary files/directories to
# make git know the hash of the HEAD.
.git
!.git/HEAD
!.git/refs
!.git/objects
.git/objects/*
EOF

echo "Building Docker Image"
Expand Down

0 comments on commit 2c1b273

Please sign in to comment.