Skip to content

Fix Makefile: Add build args to docker-buildx target#19

Merged
InftyAI-Agent merged 1 commit intoInftyAI:mainfrom
carlory:fix-docker-buildx
Jun 3, 2025
Merged

Fix Makefile: Add build args to docker-buildx target#19
InftyAI-Agent merged 1 commit intoInftyAI:mainfrom
carlory:fix-docker-buildx

Conversation

@carlory
Copy link
Copy Markdown
Member

@carlory carlory commented May 30, 2025

Dockerfile.cross:5
--------------------
   3 |
   4 |     # Build the manager binary
   5 | >>> FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} as builder
   6 |     ARG TARGETOS
   7 |     ARG TARGETARCH
--------------------
ERROR: failed to solve: base name (${BUILDER_IMAGE}) should not be blank

Test with this PR:

(base) ➜  scheduler-plugins git:(isvc) IMG=ghcr.io/carlory/inftyai/scheduler-plugins make docker-buildx
Makefile:205: warning: overriding commands for target `/Users/kiki/workspace/golang/src/github.com/inftyai/scheduler-plugins/bin'
Makefile:44: warning: ignoring old commands for target `/Users/kiki/workspace/golang/src/github.com/inftyai/scheduler-plugins/bin'
# copy existing Dockerfile and insert --platform= into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
docker buildx create --name project-v3-builder
project-v3-builder
docker buildx use project-v3-builder
docker buildx build --push --platform=linux/arm64,linux/amd64,linux/s390x,linux/ppc64le --tag ghcr.io/carlory/inftyai/scheduler-plugins --build-arg BASE_IMAGE=gcr.io/distroless/static:nonroot --build-arg BUILDER_IMAGE=golang:1.24.1 --build-arg CGO_ENABLED=  -f Dockerfile.cross .
[+] Building 1142.1s (44/44) FINISHED                                                               docker-container:project-v3-builder
...
docker buildx rm project-v3-builder
project-v3-builder removed
rm Dockerfile.cross

@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels May 30, 2025
@InftyAI-Agent InftyAI-Agent requested a review from kerthcet May 30, 2025 07:31
@kerthcet
Copy link
Copy Markdown
Member

kerthcet commented Jun 3, 2025

/retest

@kerthcet
Copy link
Copy Markdown
Member

kerthcet commented Jun 3, 2025

/lgtm
/approve
/kind cleanup

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Jun 3, 2025
@InftyAI-Agent InftyAI-Agent merged commit 416467b into InftyAI:main Jun 3, 2025
42 of 48 checks passed
@carlory carlory deleted the fix-docker-buildx branch June 3, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants