docker-docke安装和镜像仓库安装和管理
1、安装docker
# yum install -y yum-utils device-mapper-persistent-data lvm2
# yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
# yum install docker-ce -y
# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://bc437cce.m.daocloud.io
# systemctl start docker
# systemctl enable docker
[root@VM_0_14_centos ~]# ps -ef|grep docker
root 16431 1 0 16:48 ? 00:00:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
root 16690 15418 0 16:49 pts/0 00:00:00 grep --color=auto docker
[root@VM_0_14_centos ~]#
2、docker-hub安装 下载地址:https://github.com/docker/compose/releases
curl -L https://github.com/docker/compose/releases/download/1.25.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.25.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose tar -xvf harbor-offline-installer-v1.6.2.tgz && cd harbor/ 修改配置文件
[root@VM_0_14_centos harbor]# cat harbor.cfg|grep -v "#"|grep -v ^$
_version = 1.6.0
hostname = 172.19.0.14 #登录地址
ui_url_protocol = http #使用http登录
max_job_workers = 10
customize_crt = on
ssl_cert = /data/cert/server.crt
ssl_cert_key = /data/cert/server.key
secretkey_path = /data
admiral_url = NA
log_rotate_count = 50
log_rotate_size = 200M
http_proxy =
https_proxy =
no_proxy = 127.0.0.1,localhost,ui,registry
email_identity =
email_server = smtp.mydomain.com
email_server_port = 25
email_username = sample_admin@mydomain.com
email_password = abc
email_from = admin <sample_admin@mydomain.com>
email_ssl = false
email_insecure = false
harbor_admin_password = Harbor12345
auth_mode = db_auth
ldap_url = ldaps://ldap.mydomain.com
ldap_basedn = ou=people,dc=mydomain,dc=com
ldap_uid = uid
ldap_scope = 2
ldap_timeout = 5
ldap_verify_cert = true
ldap_group_basedn = ou=group,dc=mydomain,dc=com
ldap_group_filter = objectclass=group
ldap_group_gid = cn
ldap_group_scope = 2
self_registration = on
token_expiration = 30
project_creation_restriction = everyone
db_host = postgresql
db_password = root123
db_port = 5432
db_user = postgres
redis_host = redis
redis_port = 6379
redis_password =
redis_db_index = 1,2,3
clair_db_host = postgresql
clair_db_password = root123
clair_db_port = 5432
clair_db_username = postgres
clair_db = postgres
clair_updaters_interval = 12
uaa_endpoint = uaa.mydomain.org
uaa_clientid = id
uaa_clientsecret = secret
uaa_verify_cert = true
uaa_ca_cert = /path/to/ca.pem
registry_storage_provider_name = filesystem
registry_storage_provider_config =
registry_custom_ca_bundle =
[root@VM_0_14_centos harbor]# ^C
[root@VM_0_14_centos harbor]# cat harbor.cfg|grep -v "#"|grep -v ^$
_version = 1.6.0
hostname = 172.19.0.14
ui_url_protocol = http
max_job_workers = 10
customize_crt = on
ssl_cert = /data/cert/server.crt
ssl_cert_key = /data/cert/server.key
secretkey_path = /data
admiral_url = NA
log_rotate_count = 50
log_rotate_size = 200M
http_proxy =
https_proxy =
no_proxy = 127.0.0.1,localhost,ui,registry
email_identity =
email_server = smtp.mydomain.com
email_server_port = 25
email_username = sample_admin@mydomain.com
email_password = abc
email_from = admin <sample_admin@mydomain.com>
email_ssl = false
email_insecure = false
harbor_admin_password = Harbor12345 ### 登录密码
auth_mode = db_auth
ldap_url = ldaps://ldap.mydomain.com
ldap_basedn = ou=people,dc=mydomain,dc=com
ldap_uid = uid
ldap_scope = 2
ldap_timeout = 5
ldap_verify_cert = true
ldap_group_basedn = ou=group,dc=mydomain,dc=com
ldap_group_filter = objectclass=group
ldap_group_gid = cn
ldap_group_scope = 2
self_registration = on
token_expiration = 30
project_creation_restriction = everyone
db_host = postgresql
db_password = root123
db_port = 5432
db_user = postgres
redis_host = redis
redis_port = 6379
redis_password =
redis_db_index = 1,2,3
clair_db_host = postgresql
clair_db_password = root123
clair_db_port = 5432
clair_db_username = postgres
clair_db = postgres
clair_updaters_interval = 12
uaa_endpoint = uaa.mydomain.org
uaa_clientid = id
uaa_clientsecret = secret
uaa_verify_cert = true
uaa_ca_cert = /path/to/ca.pem
registry_storage_provider_name = filesystem
registry_storage_provider_config =
registry_custom_ca_bundle =
安装:
./install.sh
查看状态
docker-compose ps
[root@VM_0_14_centos harbor]# docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------------------------------------------------
harbor-adminserver /harbor/start.sh Up
harbor-db /entrypoint.sh postgres Up 5432/tcp
harbor-jobservice /harbor/start.sh Up
harbor-log /bin/sh -c /usr/local/bin/ ... Up 127.0.0.1:1514->10514/tcp
harbor-ui /harbor/start.sh Up
nginx nginx -g daemon off; Up 0.0.0.0:443->443/tcp, 0.0.0.0:4443->4443/tcp, 0.0.0.0:80->80/tcp
redis docker-entrypoint.sh redis ... Up 6379/tcp
registry /entrypoint.sh /etc/regist ... Up 5000/tcp
3、docker设置信任。
由于默认为Https访问,设置为http访问:
[root@VM_0_14_centos harbor]# cat /etc/docker/daemon.json
{"registry-mirrors": ["http://bc437cce.m.daocloud.io"],
"insecure-registries": ["172.19.0.14"]
} 设置成功后重启docker:systemctl restart docker
docker info 多了一个IP,说明设置成功
nsecure Registries:
172.19.0.14
127.0.0.0/8 重启镜像仓库 docker-compose up -d
harbor-log is up-to-date
Starting harbor-adminserver ...
Starting harbor-db ...
registry is up-to-date
Starting harbor-db
Starting redis ...
Starting harbor-adminserver
Starting harbor-adminserver ... done
Starting harbor-ui ...
Starting harbor-ui ... done
Starting nginx ...
Starting nginx
Starting harbor-jobservice ...
Starting nginx ... done
4、docker镜像仓库管理
登录:docker login 172.19.0.14
打标签: docker tag SOURCE_IMAGE[:TAG] 172.19.0.14/test/IMAGE[:TAG]
推送镜像: docker push SOURCE_IMAGE[:TAG] 172.19.0.14/test/IMAGE[:TAG]
[root@VM_0_14_centos harbor]# docker tag nginx 172.19.0.14/test/nginx:v1
[root@VM_0_14_centos harbor]# docker pull 172.19.0.14/test/nginx:v1
Error response from daemon: manifest for 172.19.0.14/test/nginx:v1 not found
[root@VM_0_14_centos harbor]# docker push 172.19.0.14/test/nginx:v1
The push refers to repository [172.19.0.14/test/nginx]
589561a3ffb4: Pushed
ef7dbb0cfc81: Pushed
d56055da3352: Pushed
v1: digest: sha256:f83b2ffd963ac911f9e638184c8d580cc1f3139d5c8c33c87c3fb90aebdebf76 size: 948
5、Portainer 安装搭建
docker volume create portainer_data docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
docker-docke安装和镜像仓库安装和管理的更多相关文章
- docker 系列 - 企业级私有镜像仓库Harbor部署(转载)
本文转载自 搜云库 的文章 https://www.jianshu.com/p/7d76850de03f , 感谢作者 3.png 上一篇文章搭建了一个具有基础功能,权限认证.TLS 的私有仓库, ...
- 03: 使用docker搭建Harbor私有镜像仓库
1.1 harbor介绍 1.Harbor简介 1. Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器. 2. 镜像的存储harbor使用的是官方的docker regi ...
- [Docker]Harbor部署私有镜像仓库
Harbor部署私有镜像仓库 认识: Harbor 是一个用于存储和分发 Docker 镜像的企业级 Registry 服务器. 部署环境: CentOS7 Python2.7.5 Docker CE ...
- 利用docker搭建本地私有镜像仓库
主机名 角色 sht-sgmhadoopcm-01 Docker Repository sht-sgmhadoopnn-01 Docker Client 1. 在两台节点分别安装docker http ...
- Docker——Registry搭建私有镜像仓库
前言 在 Docker 中,当我们执行 docker pull xxx 的时候,它实际上是从 registry.hub.docker.com 这个地址去查找,这就是Docker公司为我们提供的公共仓库 ...
- docker之搭建私有镜像仓库和公有仓库
一.搭建私有仓库 1.docker pull registry #下载registry镜像并启动 2. docker run -d -v /opt/registry:/var/lib/registry ...
- Docker入门与应用系列(六)Docker私有与公共镜像仓库
1.搭建私有镜像仓库 Docker Hub作为Docker默认官方公共镜像:如果想搭建自己的私有镜像仓库,官方提供registry镜像,使搭建私有仓库非常简单 1.1下载registry镜像并启动 d ...
- docker 新手入门 (阿里镜像仓库的使用)
创建镜像仓库后的步骤是: https://help.aliyun.com/document_detail/60743.html?spm=a2c4g.11186623.6.546.79be52f3y ...
- Docker 添加--insecure-registry 私有镜像仓库
方法一 [root@k8s-master01]# vi /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd --inse ...
随机推荐
- Nginx搭建游戏
目录 一:Nginx搭建<小游戏> 1.上传<象棋游戏>代码 2.编辑配置文件(尾部必须要加 .conf<文件>) 3.测试配置文件是否正常 4.重启Nginx 5 ...
- 从故纸堆里,回顾下Web技术的发展历程
通过对比这些年的计算机图书来让大家感受下前些年Web技术的发展历程. Web开发框架,目前是Spring Boot+JPA,我正好出过本书,从中大家能感受到现在的技术. <Spring Boot ...
- 学习JAVAWEB第八天
1. C/S:客户端/服务器端 2. B/S:浏览器/服务器端 2. 资源分类 1. 静态资源:所有用户访问后,得到的结果都是一样的,称为静态资源.静态资源可以直接被浏览器解析 * 如: html,c ...
- Pycharm 实现保存时修正格式(format_on_save)
前言 VSCODE是近年来备受欢迎的轻量级代码编辑器,有一项非常实用功能--保存时修正代码格式(formatonsave) Pycharm作为一款IDE,虽然本身不具备此功能,但通过几个并不复杂的设置 ...
- 海康NVR设备上传人脸图片到人脸库
海康开放平台--海康文档链接--海康开发包和文档下载链接 硬件:海康超脑NVR(全称Network Video Recorder,即网络视频录像机).人脸摄像机. 环境:JDK_1.8 Windows ...
- 解决No artifacts
前言:maven管理项目时显示No artifacts 错误: 第一步:找到Artifacts 第二步:点击添加 第三步:点击exploded,然后点击应用即可 注意: 名字1和名字2一定要相同 最后 ...
- github中,一些涉及到用户配置的文件怎么处理(比如数据库用户名/密码)?
感谢问题回答者:Livid 问题地址:https://www.v2ex.com/t/74245 加密方式参考:http://www.manongjc.com/detail/12-bmntimjowei ...
- JSP、Servlet和Spring MVC
感谢原博主!!!https://blog.csdn.net/whut2010hj/article/details/80874008 版权声明:本文为博主原创文章,遵循CC 4.0 BY版权协议,转载请 ...
- JSP两种声明变量的区别
感谢大佬:https://blog.csdn.net/tiercel2008/article/details/11553899?utm_source=distribute.pc_relevant.no ...
- Centos 7 下部署Django + uWSGI + Nginx
1.废话 之前利用Django写了些测试工具,一直是直接 python manage.py runserver 8081这么来用的.用户量不大,倒也不影响什么.uWSGI+Nginx的性能肯定要好,s ...