jib sample code
To build to a Docker daemon, like this.
$ ./gradlew jibDockerBuildConfirm the target image was built.
$ docker images | grep jib-sample
ghcr.io/t2y/jib-sample latest acf91de5b3f5 52 years ago 151MBConfirm the docker image information.
$ docker inspect ghcr.io/t2y/jib-sample$ docker run --rm ghcr.io/t2y/jib-sample a b c
Hello world
args[0]: a
args[1]: b
args[2]: cTo publish to a Github Packages, like this.
$ echo $CR_PAT | docker login ghcr.io -u $USERNAME --password-stdin
$ ./gradlew jib -Djib.container.labels="version.jib-sample=$(git rev-parse HEAD)"Confirm a docker image has the git revision label.
$ docker pull ghcr.io/t2y/jib-sample:latest
$ docker inspect ghcr.io/t2y/jib-sample:latest | jq '.[].Config.Labels'
{
"version.jib-sample": "478304ac"
}