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

Pulling CNB run image fails when no tag is provided in image name #21532

Closed
scottfrederick opened this issue May 21, 2020 · 2 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@scottfrederick
Copy link
Contributor

Attempting to use the builder image gcr.io/buildpacks/builder with the Maven plugin spring-boot:build-image goal or Gradle plugin bootBuildImage task results in an error while pulling the run image gcr.io/buildpacks/gcp/run specified in the builder image metadata.

Example Gradle output:

> Task :bootBuildImage
Building image 'docker.io/library/build-demo:0.0.1-SNAPSHOT'

 > Pulling builder image 'gcr.io/buildpacks/builder:latest' ..................................................
 > Pulled builder image 'gcr.io/buildpacks/builder@sha256:efb5f9b7cd976ab6e5a959f453795863a476878be8e5c20b50db22c8aec1227f'
 > Pulling run image 'gcr.io/buildpacks/gcp/run' ..................................................

> Task :bootBuildImage FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootBuildImage'.
> Different digests IDs provided
@scottfrederick scottfrederick self-assigned this May 21, 2020
@scottfrederick scottfrederick added the type: bug A general bug label May 21, 2020
@scottfrederick scottfrederick added this to the 2.3.x milestone May 21, 2020
@scottfrederick
Copy link
Contributor Author

scottfrederick commented May 21, 2020

pack CLI can successfully pull the build and run images:

$ pack build docker.io/library/build-demo --builder gcr.io/buildpacks/builder --path build/libs/build-demo-0.0.1-SNAPSHOT.jar
latest: Pulling from buildpacks/builder
11ab3a0c1a8a: Pull complete
[ ... ]
10badd04bb4a: Pull complete
Digest: sha256:efb5f9b7cd976ab6e5a959f453795863a476878be8e5c20b50db22c8aec1227f
Status: Downloaded newer image for gcr.io/buildpacks/builder:latest
latest: Pulling from buildpacks/gcp/run
11ab3a0c1a8a: Already exists
[ ... ]
dadabbc219f0: Already exists
Digest: sha256:9b3973dd6765f88815318454e337b7f5aacf25cf27f3038be49ef18cf6fce3b1
Status: Downloaded newer image for gcr.io/buildpacks/gcp/run:latest
===> DETECTING
[detector] ERROR: No buildpack groups passed detection.
[detector] ERROR: Please check that you are running against the correct path.
[detector] ERROR: failed to detect: no buildpacks participating
ERROR: failed with status code: 6

This results in both images being pulled with the latest tag:

$ docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
gcr.io/buildpacks/builder   latest              42da5db6a84f        2 hours ago         428MB
gcr.io/buildpacks/gcp/run   latest              ab8975f48640        3 hours ago         111MB

Spring Boot attempts to pull untagged images, which results in multiple run image downloads with different digests after the build failure:

$ docker images
REPOSITORY                  TAG                                        IMAGE ID            CREATED             SIZE
gcr.io/buildpacks/builder   latest                                     42da5db6a84f        3 hours ago         428MB
gcr.io/buildpacks/gcp/run   01a956fa9aad3612c9381cea556898bbcce446a0   ab8975f48640        3 hours ago         111MB
gcr.io/buildpacks/gcp/run   0416777a5a1e15b14db2b915536d59970d03a835   72d0dde704de        45 hours ago        111MB

Forcing the run image tag to latest causes Boot to behave like pack.

@scottfrederick
Copy link
Contributor Author

The docker pull CLI command defaults the tag to latest. The pack CLI also defaults the tag via the go-containerregistry library. Spring Boot should do the same.

@scottfrederick scottfrederick modified the milestones: 2.3.x, 2.3.1 May 21, 2020
@scottfrederick scottfrederick changed the title Error pulling CNB builder without tags Pulling CNB run image fails when no tag is provided in image name May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant