【harbor】--基础使用

推送

不同的管理工具都有说明

以docker为例

bash 复制代码
# 第一步--打标签
docker tag SOURCE_IMAGE[:TAG] 192.168.121.201:801/haohao_fist/REPOSITORY[:TAG]
# 第二步--推送
docker push 192.168.121.201:801/haohao_fist/REPOSITORY[:TAG]

默认push推送为https push会失败

解决办法:在docker/daemon.json中加入推送仓库

bash 复制代码
[root@localhost harbor]# cat /etc/docker/daemon.json 
{
      "registry-mirrors": [
      "https://docker.m.daocloud.io",
      "https://docker.1ms.run",
      "https://docker-0.unsee.tech",
      "https://docker.hlmirror.com",
      "https://func.ink"
    ],
    "insecure-registries" : [
        "192.168.121.201:801"
    ]
  }
bash 复制代码
# 重启docker
systemctl restart docker

# harbor可能自己启动不了--官方compose可能有问题(没有去排查了)
# 去到harbor目录下
[root@localhost harbor]# pwd
/haohao/harbor

dokcer compose down
docker compose up -d

# 查看是否启动
docker container ps

以mysql8.0.42为例:

bash 复制代码
# 登入方式
# 1
docker login 192.168.121.201:801
账户
密码

# 2
docker login -u 账号 -p 密码 192.168.121.201:801

# 3
echo 密码 | docker login -u 账户 --password-stdin 192.168.121.201:801


docker tag mysql:8.0.42 192.168.121.201:801/haohao_first/mysql:v8.0.42

docker push 192.168.121.201:801/haohao_first/mysql:v8.0.42

# 一定要退出 -- 因为在登入的时候 本地保存了一份未加密的 密码 不退出不会销毁
docker logout 192.168.121.201:801



注意:一定要logout

相关推荐
Dying.Light29 分钟前
Linux部署问题
linux·运维·服务器
S190130 分钟前
Linux的常用指令
linux·运维·服务器
萤丰信息32 分钟前
AI 筑基・生态共荣:智慧园区的价值重构与未来新途
大数据·运维·人工智能·科技·智慧城市·智慧园区
小义_1 小时前
【RH134知识点问答题】第7章 管理基本存储
linux·运维·服务器
运维小欣1 小时前
Agentic AI 与 Agentic Ops 驱动,智能运维迈向新高度
运维·人工智能
_运维那些事儿2 小时前
VM环境的CI/CD
linux·运维·网络·阿里云·ci/cd·docker·云计算
Trouvaille ~3 小时前
【Linux】UDP Socket编程实战(一):Echo Server从零到一
linux·运维·服务器·网络·c++·websocket·udp
嵌入小生0073 小时前
Shell | 命令、编程及Linux操作系统的基本概念
linux·运维·服务器
-Try hard-4 小时前
Linuv软件编程 | Shell命令
linux·运维·服务器
释怀不想释怀4 小时前
Linux快捷键,软件安装启动
linux·运维·服务器