docker的登录证书和账号查看

一、环境

docker -v

Docker version 23.0.6, build ef23cbc

二、查看登录信息

1、查看都登录了哪些仓库

cat /root/.docker/config.json


{
        "auths": {
                "registry-dev.xxx.johnny.com:18083": {
                        "auth": "YWRtaW46YWRtaW4xMjM="
                },
                "registry-public.johnny.com": {
                        "auth": "YWRtaW46YWRtaW4xMjM="
                },
                "registry.xxx.johnny.com": {
                        "auth": "YWRtaW46YWRtaW4xMjM="
                },
                "registry.kxy-nm.xxx.johnny.com": {
                        "auth": "YWRtaW46YWRtaW4xMjM="
                },
                "registry.kxy-sy.xxx.johnny.com": {
                        "auth": "YWRtaW46YWRtaW4xMjM="
                },
                "registry.xxx.johnny.com": {
                        "auth": "YWRtaW46QlI2RUpZZjM="
                },
                "repository.poc-tst.com:18083": {
                        "auth": "YWRtaW46YWRtaW4xMjM="
                }
        }
}

2、查看用户名和密码

根据上面的auth进行解析

echo "YWRtaW46YWRtaW4xMjM=" | base64 --decode

admin:admin123

三、查看证书

ll /etc/docker/certs.d/

drwxr-xr-x 2 root     root     20 821 14:48 registry-dev.johnny.com:18083
drwxr-xr-x 2 root     root     20 91 11:54 registry.johnno.com
drwxr-xr-x 2 root     root     20 91 11:54 registry.kxy-sy.johnny.com
drwxr-xr-x 2 root     root     20 816 14:54 repository.poc-tst.com:18083

ll /etc/docker/certs.d/registry.johnno.com
-rw-r--r-- 1 root root 2033 821 14:48 ca.crt

你可能感兴趣的:(docker,docker,容器)