Registry Authentication

732 views
Skip to first unread message

david david

unread,
Apr 28, 2020, 9:28:07 AM4/28/20
to Jib users
Hi,
I'm using the company's docker registry to push the Jib Gradle build image to the registry.
I'm using Docker Gradle image (with Jib plugin in it) which does the Jib build.
The image gets created using gradle jib command. However, I'm getting the below error when the image is being pushed to company's docker registry.


Errors":[{"code":"UNAUTHORIZED","message":"The client does not have permission to push to the repository


My build.gradle has the below Given code.

I had to pass the username and password using the -D param as below. 

    -Djib.to.auth.username=$USERNAME \
    -Djib.to.auth.password=$PASSWORD

Is there a way to pull the docker secret from docker.config. I can pass this file as param or deploy this as ConfigMap in Kubernetes and refer to it.


If anyone can provide more details on the best mechanism (docker.config or -D param or credHelper etc.) to pass the authentication credentials, that would be great.


Thanks in advance!

Chanseok Oh

unread,
Apr 28, 2020, 12:34:17 PM4/28/20
to Jib users
Take a look at this FAQ. In your situation, I think one easy option is to set `$DOCKER_CONFIG` (requires Jib 2.2.0).
Reply all
Reply to author
Forward
0 new messages