广告
返回顶部
首页 > 资讯 > 服务器 >安装harbor作为docker镜像仓库的问题
  • 370
分享到

安装harbor作为docker镜像仓库的问题

2024-04-02 19:04:59 370人浏览 薄情痞子
摘要

目录一、Docker和docker-compose离线部署1、上传docker-20.10.9.tgz安装包并解压2、docker.service文件3、启动Docker4、dock

安装包

docker-20.10.9.tgz

docker-compose

百度网盘下载以上两个包

链接: https://pan.baidu.com/s/1Xy6vkkxUGLmSDwrVk8ej-A 提取码: GC8r 

docker.service 如下:

[Unit]
Description=Docker Application Container Engine
Documentation=Https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
# 开启远程连接 
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes perfORMance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target

一、docker和docker-compose离线部署

1、上传docker-20.10.9.tgz安装包并解压

tar  -zxvf  docker-20.10.9.tgz 
cp docker/*  /usr/bin/

2、docker.service文件

mv docker.service /usr/lib/systemd/system/

3、启动Docker

systemctl daemon-reload 
systemctl enable docker 
systemctl start docker 
systemctl status docker

4、docker-compose部署

cp -r docker-compose /usr/local/bin/ 
cp -r docker-compose /usr/local/sbin/ 
chmod a+x /usr/local/bin/docker-compose 
chmod a+x /usr/local/sbin/docker-compose

5、测试docker-compose

docker-compose -v

二、安装harbor作为本地的仓库

  Harbor是一个开源的可信云本地注册项目,用于存储、签名和扫描内容。Harbor通过添加用户通常需要的功能(如安全性、身份和管理)扩展了开源Docker发行版。使注册表更接近构建和运行环境可以提高图像传输效率。

1、解压harbor-offline-installer-v2.3.0.tgz

tar xvf harbor-offline-installer-v1.9.3.tgz

2、进入harbor目录,修改harbor.yml

cp -r harbor.yml.tmpl harbor.yml 
vi harbor.yml
复制代码
hostname: 192.168.4.xxx                    ##对应服务器IP 
port: 80                                   ##对应harbor应用端口   
#  port: 443                               ##屏蔽https 
#  certificate: /your/certificate/path     ##屏蔽https 
#  private_key: /your/private/key/path     ##屏蔽https  
harbor_admin_passWord: llsydn123           ##harbor登录密码,根据情况修改  

3、配置docker client,编辑/etc/docker/daemon.json

Harbor的默认安装使用HTTP—因此,您需要将选项“-unsecure reGIStry”添加到客户端的Docker守护进程,并重新启动Docker服务。

vi /etc/docker/daemon.json  {"insecure-registries" : [ "192.168.4.xxx" ] }
  • 重启docker
service docker restart

4、安装 Harbor

./install.sh

5、访问harbor

http://<your_harbor_host_ip

默认用户名和密码:admin/llsydn123

好了,以上就是我个人的实操了。

到此这篇关于聊聊安装harbor作为docker镜像仓库的问题的文章就介绍到这了,更多相关docker镜像仓库harbor内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

--结束END--

本文标题: 安装harbor作为docker镜像仓库的问题

本文链接: https://www.lsjlt.com/news/151340.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作