3

I am trying to build image on offline environment using paketobuildpacks/builder:base and paketobuildpacks/run:base-cnb image. I am running a demo spring-boot project that I created via http://start.spring.io/

So this is the command I'm using to build the image

gradle clean build bootBuildImage

On my machine that has internet connection, everything works fine, and I'm able to build the image successfully. However, when I bring the same project over to my offline environment and tried to do the same, it throws me some error.

The only difference is that I need to configure this in my offline environment (build.gradle)

bootBuildImage {
  builder = "myprivateartifactory/paketobuildpacks/builder:base",
  runImage = "myprivateartifactory/paketobuildpacks/run:base-cnb"
}

The following is ran with --debug enabled - gradle clean build bootBuildImage --debug

Gradle Test Executor 6 finished executing tests.

> Task :test
Finished generating test XML results (0.008 secs) into: C:\Users\joseph\Desktop\demo (9)\demo\build\test-results\test
Generating HTML test report...
Finished generating test html results (0.004 secs) into: C:\Users\joseph\Desktop\demo (9)\demo\build\reports\tests\test
:test (Thread[Execution worker for ':' Thread 7,5,main]) completed. Took 2.708 secs.
:check (Thread[Execution worker for ':' Thread 7,5,main]) started.

> Task :check
Skipping task ':check' as it has no actions.
:check (Thread[Execution worker for ':' Thread 7,5,main]) completed. Took 0.0 secs.
:build (Thread[Execution worker for ':' Thread 7,5,main]) started.

> Task :build
Skipping task ':build' as it has no actions.
:build (Thread[Execution worker for ':' Thread 7,5,main]) completed. Took 0.0 secs.
:bootBuildImage (Thread[Execution worker for ':' Thread 7,5,main]) started.

> Task :bootBuildImage
Caching disabled for task ':bootBuildImage' because:
  Build cache is disabled
Task ':bootBuildImage' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Building image 'docker.io/library/demo:0.0.1-SNAPSHOT'

 > Pulling builder image 'cr.io/paketobuildpacks/builder:base' ..................................................
 > Pulled builder image 'cr.io/paketobuildpacks/builder@sha256:dfbd2831033f37161f5027dfa46d5a658b29a3302c33aaf0219160a05fe5c12e'

> Task :bootBuildImage FAILED
:bootBuildImage (Thread[Execution worker for ':' Thread 7,5,main]) completed. Took 2.298 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
> No 'io.buildpacks.builder.metadata' label found in image config labels 'io.buildpacks.stack.description,io.buildpacks.stack.distro.name,io.buildpacks.stack.distro.version,io.buildpacks.stack.homepage,io.buildpacks.stack.id,io.buildpacks.stack.maintainer,io.buildpacks.stack.metadata,io.buildpacks.stack.mixins,io.buildpacks.stack.released'

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 7s
8 actionable tasks: 8 executed

Setup:

spring-boot 2.4.1 / gradle 6.7.1

What am I doing wrong? If more information is required, please let me know

Thanks!

user1778855
  • 659
  • 1
  • 11
  • 29
  • https://stackoverflow.com/questions/65336624/building-docker-image-with-spring-boot-2-4-1-failes-with-missing-io-buildpacks might be related. – Kaj Hejer Dec 17 '20 at 17:10
  • 1
    You might be right.. seem related – user1778855 Dec 17 '20 at 17:46
  • I'm the one who added the question I linked to. I upvoted your question to attract more attention to it. Feel free to do the same with https://stackoverflow.com/questions/65336624/building-docker-image-with-spring-boot-2-4-1-failes-with-missing-io-buildpacks :) Thanks! – Kaj Hejer Dec 17 '20 at 18:28
  • 1
    In the interest of avoiding duplicate support, there is an issue in the Spring Boot issue tracker as well where this is discussed: https://github.com/spring-projects/spring-boot/issues/24641 – Stephane Nicoll Jan 04 '21 at 16:10
  • Thanks! Wasn't aware of the newly created issue. Will follow that issue. – user1778855 Jan 05 '21 at 04:35
  • 1
    The labels on the builder image in your private Artifactory are incorrect. Specifically, the `io.buildpacks.builder.metadata` label is missing. – Andy Wilkinson Jan 05 '21 at 12:49

1 Answers1

0

See spring-boot#24641 for more discussion. In short, the reason for the error mentioned above was that the wrong image was used.

user1778855
  • 659
  • 1
  • 11
  • 29