Skip to content
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

Build images on arm machines #20

Open
DeBr4nd opened this issue Apr 5, 2024 · 2 comments
Open

Build images on arm machines #20

DeBr4nd opened this issue Apr 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@DeBr4nd
Copy link

DeBr4nd commented Apr 5, 2024

Hi, I would like to suggest a change to the makefile in the /containers folder.

The way the file is written, when you build images on an ARM instruction set machine, such as a Mac with an Apple silicon processor (e.g. M3 Pro) the docker engine aligns and tends to download versions you applications on an arm64 basis (e.g. when apt-get install -y --no-install-recommends openjdk-17-jre-headless happens).

Doing so creates 2 problems:

  • It installs dependencies in non-canonical paths;
  • Uses arm-based software but then it will have to run on an x86/64-based k8s cluster.

That is why it is worth adding these lines to the Makefile:

ARCH_TARGET ?= linux/amd64

$(IMAGE_TARGETS) :
	$(DOCKER_CLI) buildx build $(BUILD_ARGS) --platform $(ARCH_TARGET) --tag $(BUILD_TAG_ARGUMENT) $(IMAGES_DIR)/$(@) --load

This way we force docker/podman to use x86 instructions instead of arm instructions.

I solved the problem this way. I hope I was helpful.

Max

@mdiez-tibco mdiez-tibco added the enhancement New feature or request label Apr 9, 2024
@mjohanss-tibco
Copy link
Collaborator

Hi, good suggestion. I'll see if we can add this to the Makefile.

@paulboone
Copy link

@DeBr4nd's modifications worked fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants