Skip to content

Commit

Permalink
Publish docker images with race detection
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Jan 30, 2024
1 parent cf6935a commit 860c310
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd ../.. && pwd )
source "$AVALANCHE_PATH"/scripts/constants.sh

# Build current avalanchego
source "$AVALANCHE_PATH"/scripts/build_image.sh -r
source "$AVALANCHE_PATH"/scripts/build_image.sh

if [[ $current_branch == "master" ]]; then
echo "Tagging current avalanchego image as $avalanchego_dockerhub_repo:latest"
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ RUN go mod download
COPY . .

# Build avalanchego
RUN ./scripts/build.sh
ARG RACE_FLAG=""
RUN ./scripts/build.sh ${RACE_FLAG}

# ============= Cleanup Stage ================
FROM debian:11-slim AS execution
Expand Down
4 changes: 4 additions & 0 deletions scripts/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ commit_hash="${full_commit_hash::8}"
echo "Building Docker Image with tags: $avalanchego_dockerhub_repo:$commit_hash , $avalanchego_dockerhub_repo:$current_branch"
docker build -t "$avalanchego_dockerhub_repo:$commit_hash" \
-t "$avalanchego_dockerhub_repo:$current_branch" "$AVALANCHE_PATH" -f "$AVALANCHE_PATH/Dockerfile"

echo "Building Docker Image with tags: $avalanchego_dockerhub_repo:$commit_hash-race , $avalanchego_dockerhub_repo:$current_branch-race"
docker build --build-arg="RACE_FLAG=-r" -t "$avalanchego_dockerhub_repo:$commit_hash-race" \
-t "$avalanchego_dockerhub_repo:$current_branch-race" "$AVALANCHE_PATH" -f "$AVALANCHE_PATH/Dockerfile"

0 comments on commit 860c310

Please sign in to comment.