Skip to content

Standardize Dockerfile and Makefile for improved platform handling - #1366

Open
dharsanb wants to merge 3 commits into
kubereboot:mainfrom
dharsanb:standardize-platform
Open

Standardize Dockerfile and Makefile for improved platform handling#1366
dharsanb wants to merge 3 commits into
kubereboot:mainfrom
dharsanb:standardize-platform

Conversation

@dharsanb

Copy link
Copy Markdown
Contributor

In this PR

  1. DOCKER_LOCAL_PLATFORM is added to handle arch based on the machine arch
  2. Added GOOS=linux to build for linux containers instead of the default platform GOOS

…ling

Signed-off-by: Dharsan Baskar <git@dharsanb.com>
@dharsanb
dharsanb requested a review from evrardjp June 13, 2026 02:29
@dharsanb dharsanb self-assigned this Jun 13, 2026
@dharsanb dharsanb changed the title Standardize Dockerfile and Makefile for improved platform hand… Standardize Dockerfile and Makefile for improved platform handling Jun 13, 2026
evrardjp
evrardjp previously approved these changes Jun 13, 2026

@evrardjp evrardjp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test this but it looks nice.

Do you want to add docs or a specific make target for arm?

Comment thread Dockerfile

@evrardjp evrardjp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wont' this break the release?

Comment thread Makefile
dev-image:
mkdir -p dist/docker/$(LOCAL_PLATFORM)
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$(VERSION)" -o dist/docker/$(LOCAL_PLATFORM)/kured ./cmd/kured
mkdir -p dist/docker

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we just keep LOCAL_PLATFORM (adapt it to linux/$(shell go env GOARCH)),
keep the mkdir -p dist/docker/$(LOCAL_PLATFORM) ,
merge your adaptation: CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w -X main.version=$(VERSION)" -o dist/docker/$(LOCAL_PLATFORM)/kured ./cmd/kured
and keep $(SUDO) docker buildx build --load --platform $(LOCAL_PLATFORM) -t $(DEV_IMAGE) dist/docker ?

wouldn't that work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants