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

Provide Gradle GraalVM compatible builder image #6513

Closed
Meemaw opened this issue Jan 12, 2020 · 10 comments · Fixed by #7427
Closed

Provide Gradle GraalVM compatible builder image #6513

Meemaw opened this issue Jan 12, 2020 · 10 comments · Fixed by #7427
Labels
area/housekeeping Issue type for generalized tasks not related to bugs or enhancements
Milestone

Comments

@Meemaw
Copy link

Meemaw commented Jan 12, 2020

Description
In creating-a-container-with-a-multi-stage-docker-build guide there is a Maven docker base image with GraalVM capabilities.

It would be nice if there was one for projects using Gradle as well.

@Meemaw Meemaw added the area/housekeeping Issue type for generalized tasks not related to bugs or enhancements label Jan 12, 2020
@Meemaw Meemaw changed the title Provide Gradle compatible builder image Provide Gradle GraalVM compatible builder image Jan 12, 2020
@geoand
Copy link
Contributor

geoand commented Jan 13, 2020

cc @cescoffier

@cescoffier
Copy link
Member

Yes, that's relatively easy. We already have a module installing Gradle.

We just need:

1 - add Gradle to https://github.com/quarkusio/quarkus-images/blob/master/quarkus-maven-overrides-java8.yaml#L27
2 - Rename the image
3 - Update the documentation

The hardest, as usual, would be to find the right name for this image...

@gastaldi
Copy link
Contributor

The hardest, as usual, would be to find the right name for this image...

centos-quarkus-gradle?

@cescoffier
Copy link
Member

The same image would provide maven and gradle.

@gastaldi
Copy link
Contributor

Maybe something like centos-quarkus-builder since it's meant to be used to build the app :)

@gsmet
Copy link
Member

gsmet commented Jan 31, 2020

@fmhwong maybe you could have a look at that one too?

@fmhwong
Copy link
Contributor

fmhwong commented Feb 14, 2020

@cescoffier Do you have a preference of making a copy of quarkus-maven-overrides-java8.yaml and quarkus-maven-overrides-java11.yaml, making the changes in the copy and check them in OR modify the existing files?

@k0staa
Copy link

k0staa commented Apr 4, 2020

Maybe it will be useful to someone. This is a quick workaround

## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/centos-quarkus-maven:19.3.1-java11 AS build
COPY src /usr/src/app/src
COPY gradle /usr/src/app/gradle
COPY gradlew /usr/src/app
COPY build.gradle.kts /usr/src/app
COPY settings.gradle.kts /usr/src/app
COPY gradle.properties /usr/src/app
USER root
RUN chown -R quarkus /usr/src/app
USER quarkus
WORKDIR /usr/src/app/
RUN ./gradlew clean build -Dquarkus.package.type=native

## Stage 2 : create the docker final image
FROM registry.access.redhat.com/ubi8/ubi-minimal
WORKDIR /work/
COPY --from=build /usr/src/app/build/*-runner /work/application
RUN chmod 775 /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

One thing. I use Kotlin in Gradle configuration so if you don't use Kotlin, remove extensions in build.gradle.kts and settings.gradle.kts files.

@gastaldi
Copy link
Contributor

gastaldi commented Apr 4, 2020

@k0staa we're deprecating gradle buildNative in favor of gradle build -Dquarkus.package.type=native. See #8325 for more details

@k0staa
Copy link

k0staa commented Apr 11, 2020

@k0staa we're deprecating gradle buildNative in favor of gradle build -Dquarkus.package.type=native. See #8325 for more details

Thanks @gastaldi . I edited my post and also I change build command in my project.

@gsmet gsmet added this to the 1.10 - master milestone Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/housekeeping Issue type for generalized tasks not related to bugs or enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants