Skip to content

Commit

Permalink
pass down tag_name into Dockerfile.cross
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosnacks committed Jan 21, 2025
1 parent b5fb2f7 commit 64c2370
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ FROM ubuntu:22.04

# Filled by docker buildx
ARG TARGETARCH
ARG TAG_NAME

ENV TAG_NAME=something
ENV TAG_NAME=${TAG_NAME}

COPY ./dist/bin/$TARGETARCH/* /usr/local/bin/

Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# Cargo profile for builds.
PROFILE ?= dev
TAG_NAME ?= dev

# The docker image name
DOCKER_IMAGE_NAME ?= ghcr.io/foundry-rs/foundry:latest
BIN_DIR = dist/bin
Expand Down Expand Up @@ -56,7 +58,7 @@ docker-build-push: docker-build-prepare ## Build and push a cross-arch Docker im
cp $(CARGO_TARGET_DIR)/aarch64-unknown-linux-gnu/$(PROFILE)/$$bin $(BIN_DIR)/arm64/; \
done

docker buildx build --file ./Dockerfile.cross . \
docker buildx build --file ./Dockerfile.cross --build-arg TAG_NAME=$(TAG_NAME) . \
--platform linux/amd64,linux/arm64 \
$(foreach tag,$(shell echo $(DOCKER_IMAGE_NAME) | tr ',' ' '),--tag $(tag)) \
--provenance=false \
Expand Down

0 comments on commit 64c2370

Please sign in to comment.