Skip to content

Wrong token specified for the DHI_API_TOKEN var #26119

Description

@gotdenik

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

The last part of the page explains that if you want to use the DHI_API_TOKEN env var, you should generate a token in the docker hub account settings. Which is essentially a Personal access token. And is actually not the type of token that the var needs. The var should specify a JWT token not a PAT token.

Location

https://docs.docker.com/dhi/tools/cli/

Suggestion

To obtain the JWT token, the Personal access token is definitely necessary, you need to go to your docker hub account settings then go to Personal Access Token then generate one PAT with the correct rights you need. Then run this command to auth to the API and obtain the JWT token:
curl -s -X POST https://hub.docker.com/v2/auth/token -H "Content-Type: application/json" -d '{"identifier":"<HUB_USERNAME>","secret":"<PERSONAL_ACCESS_TOKEN"}' | jq -r .access_token

Then export the DHI_API_TOKEN=<JWT_TOKEN>.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions