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 and publish an ARM variant of the docker image #106

Open
stv-io opened this issue Jan 10, 2023 · 6 comments · May be fixed by #117
Open

Build and publish an ARM variant of the docker image #106

stv-io opened this issue Jan 10, 2023 · 6 comments · May be fixed by #117

Comments

@stv-io
Copy link

stv-io commented Jan 10, 2023

Currently it seems like the only os/arch combo the docker image being built is linux/amd64.

For our case, it would be a cost-saving initiative to have an ARM image, to be able to utilise the more cost effective (and for the next 12 months, essentially free) t4g instances in AWS (currently running nicely and happily, 24x7 on t2.small)

Reference - https://aws.amazon.com/ec2/faqs/#t4g-instances

I'm not familiar (yet) with buildpack configuration, so I won't be able to submit a PR myself as of this time.

@hyness
Copy link
Owner

hyness commented Jan 27, 2023

Hello @stv-io ,

I think it's a great idea to provide OCI images for other architectures. If you can provide a PR, I would gladly accept it. If not, I can guarantee I will look into adding this, I just cannot say when I will have time

Thanks!

@stv-io
Copy link
Author

stv-io commented Jan 30, 2023

I would be happy to do so, but for me to be using tools I'm comfortable with, I'd expect the gradle build and the docker build to be separate processes. i.e../gradlew clean build builds a jar, and that jar is dropped into a docker image, using a Dockerfile.

Also, according to the buildpack docs:

As of today, there are no known released CNB builder images that support building ARM application images.

So, I would say, as the maintainer of this repo, would you be happy with replacing the github actions with their "functional equivalent" for building the jar via gradle, and then the container image using docker/podman/kaniko or similar? If so, I'd be happy to create a PR

@hyness
Copy link
Owner

hyness commented Jan 31, 2023

Hello @stv-io . We only recently converted the build from an exploded jar using Dockerfiles to CNB, I don't want to go backwards. There is more to that link to describe how it can be done with a custom build invoking the lifecycle directly. Also, I'm interested in exploring a native build with GraalVM and Spring Boot 3.0, which would make it easy to build for multiple architectures. However, all of that will take time, which I'm in short supply of currently. You are welcome to fork the project and change how it's built until a time where I can supply the ARM images without using a Dockerfile

@Mahooki
Copy link

Mahooki commented Aug 31, 2023

In case it helps, I needed a native ARM version and was able to build and run it by just replacing the paketo builder (which doesn't seem to support ARM builds yet) to builder.set("dashaun/builder-arm:tiny").
image

@hyness
Copy link
Owner

hyness commented Sep 1, 2023

Hello @Mahooki ,

Thank you very much for this! I will definitely see about integrating that into the build, hopefully soon (I feel terribly guilty that this was requested so long ago and haven't been able to accommodate the request).

Thanks again!

@hyness
Copy link
Owner

hyness commented Oct 13, 2023

I explored using this builder to create arm64 images, however it builds a native image which isn't support by Spring Cloud Config Server. Looks like this requires a lower level Dockerfile build. I will gladly accept a PR for this, if I don't receive one, I will try to implement this when I have time, which has been in short supply

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

Successfully merging a pull request may close this issue.

3 participants