zl程序教程

您现在的位置是:首页 >  工具

当前栏目

发布自己的镜像至Docker Hub中

Docker镜像 发布 自己 HUB
2023-06-13 09:15:11 时间

发布自己的镜像

  1. https://registry.hub.docker.com/中注册自己的dockerHub账号
  2. 登陆我们的账号
  3. 在服务器上提交自己的镜像
[root]# docker login --help
Usage:  docker login [OPTIONS] [SERVER]

Log in to a Docker registry.
If no server is specified, the default is defined by the daemon.

Options:
  -p, --password string   Password
      --password-stdin    Take the password from stdin
  -u, --username string   Username

登陆成功

[root]# docker login -u nanjustar
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
  1. 登陆成功之后我们只需要是因docker push命令进行发布即可

我们在这里选择发布红框框中的镜像

[root@iZ2zehqn8uqylq6ei48mb2Z /]# docker push nanju/diy:latest
The push refers to repository [docker.io/nanju/diy]
An image does not exist locally with the tag: nanju/diy

这里的报错是指我们没有给镜像设置一个tag,那麽我们就给镜像设置一个tag。

[root@iZ2zehqn8uqylq6ei48mb2Z /]# docker tag f41341c036a3 nanju/diy:1.0

设置完成之后我们再次查看本地的镜像列表

这样我们设置tag的镜像已经出现了 我们发布带有tag的镜像

在这里可能会出现拒绝的问题,这里只需要我们修改tag,tag/前的名字必须使用dockers Hub中的用户名才可以! 开始上传了!

提交的时候也是按照层级来进行提交的!

树苗如果因为怕痛而拒绝修剪,那就永远不会成材。