Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker login auth token

I'm trying to get docker login auth from ~/.docker/config.json file. But I can't see auth token in my config.json file. Here is my docker version.

docker version Client:  Version:      17.03.1-ce  API version:  1.27  Go version:   go1.7.5  Git commit:   c6d412e  Built:        Tue Mar 28 00:40:02 2017  OS/Arch:      darwin/amd64  Server:  Version:      17.03.1-ce  API version:  1.27 (minimum version 1.12)  Go version:   go1.7.5  Git commit:   c6d412e  Built:        Fri Mar 24 00:00:50 2017  OS/Arch:      linux/amd64  Experimental: true 

When I run cat ~/.docker/config.json then what I can see is

cat .docker/config.json {     "auths": {         "https://index.docker.io/v1/": {}     },     "credsStore": "osxkeychain" }% 

According to Codeship documentation I should have to see

{     "auths": {         "https://index.docker.io/v1/": {             "auth": "auth_key",             "email": "email"         }     } } 

Can I disable storing my authkey in keychain?

I really need to get auth_key, how can I get that?

Thank you

like image 845
Gayan Avatar asked Apr 16 '17 19:04

Gayan


People also ask

What is docker access token?

Access tokens are valuable for building integrations, as you can issue multiple tokens – one for each integration – and revoke them at any time. Note. If you have two-factor authentication (2FA) enabled on your account, you must create at least one personal access token.

What is Auth in docker config json?

Auth is simply a base64 encoded 'username:password' string. You can get it with the following command: echo -n 'username:password' | base64. Follow this answer to receive notifications.


2 Answers

Auth is simply a base64 encoded 'username:password' string. You can get it with the following command:

echo -n 'username:password' | base64 
like image 89
Roman Timushev Avatar answered Sep 25 '22 23:09

Roman Timushev


If you are using Kubernetes, and you need it for creating the registry password just run:

kubectl create secret docker-registry --dry-run=true docker-regcred \ --docker-server=https://index.docker.io/v1/ \ --docker-username=xxx \ --docker-password=xxx \ [email protected] \ --namespace=xxx \ -o yaml > docker-secret.yaml 

This will create docker-secret.yaml with your JSON there. if you dont include --dry-run=client and -o yaml > docker-secret.yaml It will create the k8s secret.

like image 38
NicoKowe Avatar answered Sep 22 '22 23:09

NicoKowe