Skip to content

Using Jib to push Images to Github

Create a Github Personal Access Token

Validate Account via docker login

# export CR_PAT=<YOUR-TOKEN>
# echo $CR_PAT | /usr/bin/docker login -u USERNAME --password-stdin
  WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
  Configure a credential helper to remove this warning. See

  Login Succeeded

Validate Github Connectivity with Docker

# docker pull hello-world
  Using default tag: latest
  latest: Pulling from library/hello-world
  Digest: sha256:cc15c5b292d8525effc0f89cb299f1804f3a725c8d05e158653a563f15e4f685
  Status: Downloaded newer image for hello-world:latest

# docker images hello-world
  hello-world   latest    feb5d9fea6a5   8 weeks ago   13.3kB
# docker tag hello-world

# docker images
  REPOSITORY                         TAG       IMAGE ID       CREATED       SIZE   latest    feb5d9fea6a5   8 weeks ago   13.3kB

# docker push
  Using default tag: latest
  The push refers to repository []
  e07ee1baac5f: Mounted from hhutzler/hello-world2
  latest: digest: sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 size: 525

Use Jib to push Images to our Githup Repo


  • Successfull docker login to Github Repo
  • Use to specifiy Github Account
  • Without switch docker login data will be used
  • If using use the Github Personal Access Token for Login
  • Docker logins are captured in ~/.docker/config.json
Download Google Sample:
# git clone
# cd java-docs-samples/run/helloworld

Push Image:
# mvn  compile
  [INFO] Containerizing application to
  [WARNING] Base image 'adoptopenjdk:11-jre' does not use a specific image digest - build may not be reproducible
  [INFO] Using credentials from Docker config (/root/.docker/config.json) for
  [INFO] The base image requires auth. Trying again for adoptopenjdk:11-jre...
  [INFO] Using base image with digest: sha256:ad6431b2e2a6f8016aa6d79c3f588783af9fdc06cafe131fd0d3faf560914b13
  [INFO] Container entrypoint set to [java, -cp, @/app/jib-classpath-file, com.example.helloworld.HelloworldApplication]
  [INFO] Built and pushed image as
  [INFO] Executing tasks:
  [INFO] [============================  ] 91.7% complete
  [INFO] > launching layer pushers
  [INFO] ------------------------------------------------------------------------
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  7.408 s
  [INFO] Finished at: 2021-11-20T17:43:14+01:00
  [INFO] ------------------------------------------------------------------------

Validate Image Status on Github

  • Image hello-world should be uploaded to your Github Account

Published inQuarkus

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *