<p>You can generate an access token for docker hub by going here:</p>

<p><a href="https://hub.docker.com/settings/security" rel="nofollow noreferrer">https://hub.docker.com/settings/security</a></p>

<p>And creating a new access token.</p>

<p>It's essentially the same process for organisational access tokens or for personal access tokens IIRC.</p>

<p>Once you have generated the access token you can literally just use that token instead of the password for most docker hub operations (ie. <code>docker login --username $user --password $token</code>) </p>

CC BY-SA 4.0
2020-02-28T04:03:47.490Z
2020-02-28T04:03:47.490Z
hvindin
<p>If you are using Jenkins the answer is in this document:</p>

<p><a href="https://getintodevops.com/blog/building-your-first-docker-image-with-jenkins-2-guide-for-developers" rel="nofollow noreferrer">https://getintodevops.com/blog/building-your-first-docker-image-with-jenkins-2-guide-for-developers</a></p>

<p><a href="https://i.sstatic.net/fWujG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fWujG.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/7JvTP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7JvTP.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2019-01-18T00:46:50.973Z
Hello, as far as I understand I need credentials from DockerHub, not the other way around.
Kev
CC BY-SA 4.0
2019-01-20T06:10:05.663Z
@amida Make sure to mask them in your build pipeline as well so that they do not show up in the logs or in the console dump...
Soumen Mukherjee
CC BY-SA 4.0
2019-01-17T19:05:13.387Z
2019-01-17T19:46:37.357Z
2019-01-17T19:46:37.357Z
maskeda
<p>I was asked to use Docker Hub as part of a build/deploy pipeline.
I am supposed to provide some authentication credentials to a third-party tool, so that this tool can push container images to private repos.</p>

<p>Now, I don't see any place where I can generate secrets/API key that are safe to give to that third-party. Am I missing something? In Amazon for example I can create roles with IAM.</p>

<p>Note: The platform I tried to use is banzaicloud.com . Trying to setup a basic Nodejs app following their instructions. As far as I'm concerned, the problem of authentication should not be on the third-party tools side. The same way I can generate API keys for any kind of service and use them in whatever client I want. In the platform I refer to, it seems only the "full docker hub account" credentials can be used instead of some kind of dedicated third party mechanism (like API keys or IAM, etc).</p>

<dockerhub>
How to create credentials for Docker Hub?
Kev
# How to create credentials for Docker Hub?

(Asked by: username_0 on 2019-01-17)

I was asked to use Docker Hub as part of a build/deploy pipeline.
I am supposed to provide some authentication credentials to a third-party tool, so that this tool can push container images to private repos.

Now, I don't see any place where I can generate secrets/API key that are safe to give to that third-party. Am I missing something? In Amazon for example I can create roles with IAM.

Note: The platform I tried to use is banzaicloud.com . Trying to setup a basic Nodejs app following their instructions. As far as I'm concerned, the problem of authentication should not be on the third-party tools side. The same way I can generate API keys for any kind of service and use them in whatever client I want. In the platform I refer to, it seems only the "full docker hub account" credentials can be used instead of some kind of dedicated third party mechanism (like API keys or IAM, etc).

**Tags:** dockerhub


---

## 2 answers

### Answer by username_1 on 2020-02-28. Score: 1

You can generate an access token for docker hub by going here:

<https://hub.docker.com/settings/security>

And creating a new access token.

It's essentially the same process for organisational access tokens or for personal access tokens IIRC.

Once you have generated the access token you can literally just use that token instead of the password for most docker hub operations (ie. `docker login --username $user --password $token`)


---

### Answer by username_2 on 2019-01-17. Score: 0

If you are using Jenkins the answer is in this document:

<https://getintodevops.com/blog/building-your-first-docker-image-with-jenkins-2-guide-for-developers>

[![enter image description here](https://i.sstatic.net/fWujG.png)](https://i.sstatic.net/fWujG.png)

[![enter image description here](https://i.sstatic.net/7JvTP.png)](https://i.sstatic.net/7JvTP.png)

> **Comments:**
> **username_0**: Hello, as far as I understand I need credentials from DockerHub, not the other way around.  
> **username_3**: @amida Make sure to mask them in your build pipeline as well so that they do not show up in the logs or in the console dump...  

---

