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

Dockerfile build strategy disabled by runtime() specification #205

Open
shaunsmith opened this issue Jun 8, 2021 · 0 comments
Open

Dockerfile build strategy disabled by runtime() specification #205

shaunsmith opened this issue Jun 8, 2021 · 0 comments

Comments

@shaunsmith
Copy link

Steps to Reproduce

Create a function:

$ mn create-function-app myfunction --features oracle-function
$ cd myfunction
$ ./gradlew dockerfile
Dockerfile written to: ...myfunction/build/docker/Dockerfile
$ cat ...myfunction/build/docker/Dockerfile

Result:

FROM fnproject/fn-java-fdk:jre11-latest
WORKDIR /function
RUN mkdir -p /function/app/resources
COPY layers/libs/*.jar /function/app/
COPY layers/resources/* /function/app/resources/
COPY layers/application.jar /function/app/
CMD ["myfunction.Function::handleRequest"]

NOTE correct FROM fnproject/fn-java-fdk:jre11-latest

Edit build.gradle to add runtime("netty") to micronaut{...} section and regenerate Dockerfile.

micronaut {
    runtime("jetty")
    testRuntime("junit5")
    processing {
        incremental(true)
        annotations("myfunction.*")
    }
}
$ ./gradlew dockerfile
Dockerfile written to: /Users/shaun/tmp/myfunction/build/docker/Dockerfile
$ cat /Users/shaun/tmp/myfunction/build/docker/Dockerfile

Result:

FROM openjdk:16-alpine
WORKDIR /home/app
COPY layers/libs /home/app/libs
COPY layers/resources /home/app/resources
COPY layers/application.jar /home/app/application.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/home/app/application.jar"]

The specified build.gradle Dockerfile build strategy was silently ignored.

dockerfile {
    buildStrategy.set(io.micronaut.gradle.docker.DockerBuildStrategy.ORACLE_FUNCTION)
    defaultCommand.set("myfunction.Function::handleRequest")
}

Expected Behaviour

Error or warning that declared Dockerfile strategy is not being used/overridden/something?

Environment Information

  • Operating System: macOS 10.15 (Catalina)
  • Micronaut Version: CLI version 2.5.4 and 2.5.5
  • JDK Version: GraalVM Enterprise 20.3.1.2
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

No branches or pull requests

1 participant