Create a Docker image in the GitHub Package Registry. This time, the goal is to create an image of a Java application with Jib and push it.
Official Publish JAR to GitHub Package Registry with Gradle
build.gradle
plugins {
id 'com.google.cloud.tools.jib' version '1.5.1'
}
jib {
to {
image = "docker.pkg.github.com/minebreaker/abukuma/abukuma-example:0.0.0.2-EXPLORING_GITHUB_REGISTRY"
auth {
username = project.hasProperty("GITHUB_USER") ? GITHUB_USER : ''
password = project.hasProperty("GITHUB_TOKEN") ? GITHUB_TOKEN : ''
}
}
}
It should be noted that even if the user name or repository is in uppercase, it must be converted to lowercase.
Build & publish with jib
task immediately.
* What went wrong:
Execution failed for task ':abukuma-example:jib'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Tried to check BLOB exists for docker.pkg.github.com/minebreaker/abukuma/abukuma-example with digest sha256:e8d8785a314f385d3675a017f4e2df1707c528c06e7a7989663fdab4900bd8ff but failed because: Did not receive Content-Length header | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new
This is suspicious. .. .. If you can't see the Content-Length, it's likely that you're not responding to your request.
There is no help for it, so just create an image with jibDockerBuild
.
Built image to Docker daemon as docker.pkg.github.com/minebreaker/abukuma/abukuma-example:0.0.0.2-EXPLORING_GITHUB_REGISTRY
Executing tasks:
[==============================] 100.0% complete
> Task :abukuma-example:jibDockerBuild
BUILD SUCCESSFUL in 10s
According to the documentation, I was able to push without problems.
docker login docker.pkg.github.com -u minebreaker -p [[TOKEN]]
docker push docker.pkg.github.com/minebreaker/abukuma/abukuma-example:0.0.0.2-EXPLORING_GITHUB_REGISTRY
pull.
docker pull docker.pkg.github.com/minebreaker/abukuma/abukuma-example:0.0.0.2-exploring_github_registry
I want to complete it with Jib ...
Recommended Posts