Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

carlory
Copy link
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
Member

kerthcet commented Jun 3, 2025

/retest

@kerthcet
Copy link
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