Docker:登录私有仓库\退出私有仓库

2023-12-28 15:41:00

一、登入仓库

????????docker login :?登陆到一个Docker镜像仓库,如果未指定镜像仓库地址,默认为官方仓库 Docker Hub

语法: docker login [OPTIONS] [SERVER]


docker login -u 用户名 -p 密码 仓库名称? ? ? # 登入私有仓库

[root@localhost?~]# docker login --username=用户名 registry.cn-hangzhou.aliyuncs.com

Password:?


WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

二、退出仓库

????????docker logout :?登出一个Docker镜像仓库,如果未指定镜像仓库地址,默认为官方仓库 Docker Hub

语法: docker logout [SERVER]? ? ? ? ?# 退出默认官方仓库
[root@localhost?~]# docker logout?
Removing login credentials for https://index.docker.io/v1/
# 退出私有仓库

[root@localhost~]# docker logout registry.cn-hangzhou.aliyuncs.com
Removing login credentials for registry.cn-hangzhou.aliyuncs.com

文章来源:https://blog.csdn.net/hhd1988/article/details/135268315
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。