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安装和镜像仓库安装和管理的更多相关文章

  1. docker 系列 - 企业级私有镜像仓库Harbor部署(转载)

     本文转载自 搜云库 的文章 https://www.jianshu.com/p/7d76850de03f  , 感谢作者 3.png 上一篇文章搭建了一个具有基础功能,权限认证.TLS 的私有仓库, ...

  2. 03: 使用docker搭建Harbor私有镜像仓库

    1.1 harbor介绍 1.Harbor简介 1. Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器. 2. 镜像的存储harbor使用的是官方的docker regi ...

  3. [Docker]Harbor部署私有镜像仓库

    Harbor部署私有镜像仓库 认识: Harbor 是一个用于存储和分发 Docker 镜像的企业级 Registry 服务器. 部署环境: CentOS7 Python2.7.5 Docker CE ...

  4. 利用docker搭建本地私有镜像仓库

    主机名 角色 sht-sgmhadoopcm-01 Docker Repository sht-sgmhadoopnn-01 Docker Client 1. 在两台节点分别安装docker http ...

  5. Docker——Registry搭建私有镜像仓库

    前言 在 Docker 中,当我们执行 docker pull xxx 的时候,它实际上是从 registry.hub.docker.com 这个地址去查找,这就是Docker公司为我们提供的公共仓库 ...

  6. docker之搭建私有镜像仓库和公有仓库

    一.搭建私有仓库 1.docker pull registry #下载registry镜像并启动 2. docker run -d -v /opt/registry:/var/lib/registry ...

  7. Docker入门与应用系列(六)Docker私有与公共镜像仓库

    1.搭建私有镜像仓库 Docker Hub作为Docker默认官方公共镜像:如果想搭建自己的私有镜像仓库,官方提供registry镜像,使搭建私有仓库非常简单 1.1下载registry镜像并启动 d ...

  8. docker 新手入门 (阿里镜像仓库的使用)

    创建镜像仓库后的步骤是:   https://help.aliyun.com/document_detail/60743.html?spm=a2c4g.11186623.6.546.79be52f3y ...

  9. Docker 添加--insecure-registry 私有镜像仓库

    方法一 [root@k8s-master01]# vi /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd --inse ...

随机推荐

  1. Java微服务监控及与普罗米集成

    一.    背景说明 Java服务级监控用于对每个应用占用的内存.线程池的线程数量.restful调用数量和响应时间.JVM状态.GC信息等进行监控,并可将指标信息同步至普罗米修斯中集中展示和报警.网 ...

  2. JQuery高级部分

    简介 对动画.遍历.事件绑定的介绍. 操作 动画 三种方式显示和隐藏元素 show([speed,[easing],[fn]]) 默认显示和隐藏方式 参数: speed:动画的速度.三个预定义的值(& ...

  3. git rm 与 git rm --cached 的区别

    感谢原文作者:book_02 原文链接:https://www.jianshu.com/p/1c442fd398b7 git rm : 同时从工作区和索引中删除文件.即本地的文件也被删除了. git ...

  4. Python调用windows下DLL详解 - ctypes库的使用

    在python中某些时候需要C做效率上的补充,在实际应用中,需要做部分数据的交互.使用python中的ctypes模块可以很方便的调用windows的dll(也包括linux下的so等文件),下面将详 ...

  5. VMware14安装windows7的详细过程

    感谢大佬:https://blog.csdn.net/u012230668/article/details/81701893 一.安装VMware虚拟机,以及下载一份ghost win7系统 下载地址 ...

  6. DAG(有向无环图)技术

    什么是DAG? DAG的全称为"Directed Acyclic Graph",中文意思为:有向无环图,它由有限个顶点和"有向边"组成,从任意顶点出发,经过若干 ...

  7. 基于zynq XC7Z100 FMC接口通用计算平台

    1.板卡概述 此板卡是北京太速研发,由SoC XC7Z100-2FFG900I芯片来完成卡主控及数字信号处理,XC7Z100内部集成了两个ARM Cortex-A9核和一个kintex 7的FPGA, ...

  8. suse 12 二进制部署 Kubernetets 1.19.7 - 第02章 - 部署etcd集群

    文章目录 1.2.部署etcd集群 1.2.0.下载etcd二进制文件 1.2.1.创建etcd证书和私钥 1.2.2.生成etcd证书和私钥 1.2.3.配置etcd为systemctl管理 1.2 ...

  9. Java老码农心得:卷了这么多年,您真的卷会了吗?

    前言 大家好,我是福隆苑居士,今天跟大家聊一下程序员在当下内卷成风的情况下,使用什么方法可以了解行业发展趋势,知道哪些该学,哪些可以略过,今年应该掌握什么,可以放弃什么,让自己时刻紧跟行业的步伐永不掉 ...

  10. ASP.NET Core 6框架揭秘实例演示[07]:文件系统

    ASP.NET Core应用具有很多读取文件的场景,如读取配置文件.静态Web资源文件(如CSS.JavaScript和图片文件等).MVC应用的视图文件,以及直接编译到程序集中的内嵌资源文件.这些文 ...