docker 搭建私有云仓库
docker搭建私有仓库
registry私有仓库
下载docker-distribution软件包
yum install epel-release
yum install docker-distribution
查看docker-distribution配置文件

[root@localhost registry]# vim /etc/docker-distribution/registry/config.yml
version: 0.1 #版本
log:
fields:
service: registry #服务名称
storage:
cache:
layerinfo: inmemory
filesystem:
rootdirectory: /var/lib/registry #镜像目录
http:
addr: :5000 #docker-distribution监听的端口

启动服务
[root@localhost registry]# systemctl restart docker-distribution
查看5000端口是否启动

[root@localhost registry]# ss -tnl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:111 *:*
LISTEN 0 5 192.168.122.1:53 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 :::5000 :::*
LISTEN 0 128 :::111 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25 :::*

查看本地镜像
[root@localhost registry]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
myos latest c14c79e9da64 4 weeks ago 466MB
centos latest 9f38484d220f 6 months ago 202MB
现在我们把centos这个镜像打上标签并且推送到registry中

[root@localhost registry]# docker tag centos 192.168.254.11:5000/centos:latest [root@localhost registry]# docker push 192.168.254.11:5000/centos
The push refers to repository [192.168.254.11:5000/centos]
d69483a6face: Pushed
latest: digest: sha256:ca58fe458b8d94bc6e3072f1cfbd334855858e05e1fd633aa07cf7f82b048e66 size: 529

查看registry服务器
[root@localhost repositories]# ls -ltr /var/lib/registry/docker/registry/v2/repositories
total 0
drwxr-xr-x. 5 root root 55 Sep 13 10:28 centos
drwxr-xr-x. 5 root root 55 Sep 13 10:48 mysql
镜像已经上传上来了,OK
harbor私有仓库
下载harbor包
wget https://storage.googleapis.com/harbor-releases/release-1.4.0/harbor-offline-installer-v1.4.0.tgz
解压包并进入目录
tar -zxvf harbor-offline-installer-v1.4.0.tgz -C /usr/local/
cd /usr/local/harbor
编辑配置文件

vim harbor.cfg
hostname = 192.168.254.13 #对外访问地址
ui_url_protocol = http #访问方式
max_job_workers = 3 #最大处理进程数
customize_crt = on #是否要启动自定义证书,如果ui_url_protocol = http不生效,如果是https才会生效
harbor_admin_password = Harbor12345 #admin用户的密码

执行文件
[root@master harbor]# ./install.sh
note:容器名字不能有registry这个名字,否则脚本执行失败
浏览器访问http://server_ip
创建项目
创建仓库
修改访问地址
[root@master harbor]# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://l10nt4hq.mirror.aliyuncs.com"],
"insecure-registries":["192.168.254.13"]
}
重启docker服务
[root@master harbor]# service docker restart
Redirecting to /bin/systemctl restart docker.service
在linux下登录harbor
查看现有的镜像

[root@master harbor]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.aliyuncs.com/google_containers/kube-proxy v1.15.3 232b5c793146 3 weeks ago 82.4 MB
registry.aliyuncs.com/google_containers/kube-apiserver v1.15.3 5eb2d3fc7a44 3 weeks ago 207 MB
registry.aliyuncs.com/google_containers/kube-scheduler v1.15.3 703f9c69a5d5 3 weeks ago 81.1 MB
registry.aliyuncs.com/google_containers/kube-controller-manager v1.15.3 e77c31de5547 3 weeks ago 159 MB
docker.io/mariadb latest 99c1098d5884 4 weeks ago 355 MB
docker.io/mysql latest 62a9f311b99c 4 weeks ago 445 MB
quay.io/coreos/flannel v0.11.0-amd64 ff281650a721 7 months ago 52.6 MB
registry.aliyuncs.com/google_containers/coredns 1.3.1 eb516548c180 8 months ago 40.3 MB
registry.aliyuncs.com/google_containers/etcd 3.3.10 2c4adeb21b4f 9 months ago 258 MB
vmware/clair-photon v2.0.1-v1.4.0 a1df3526fe43 19 months ago 300 MB
vmware/notary-server-photon v0.5.1-v1.4.0 3edfddb8ece2 19 months ago 211 MB
vmware/notary-signer-photon v0.5.1-v1.4.0 cc70a05cdb6a 19 months ago 209 MB
vmware/registry-photon v2.6.2-v1.4.0 8920f621ddd1 19 months ago 198 MB
vmware/nginx-photon v1.4.0 20c8a01ac6ab 19 months ago 135 MB
vmware/harbor-log v1.4.0 9e818c7a27ab 19 months ago 200 MB
vmware/harbor-jobservice v1.4.0 29c14d91b043 19 months ago 191 MB
vmware/harbor-ui v1.4.0 6cb4318eda6a 19 months ago 210 MB
vmware/harbor-adminserver v1.4.0 8145970fa013 19 months ago 182 MB
vmware/harbor-db v1.4.0 c38da34727f0 19 months ago 521 MB
vmware/mariadb-photon v1.4.0 8457013cf6e3 19 months ago 521 MB
vmware/postgresql-photon v1.4.0 59aa61520094 19 months ago 221 MB
vmware/harbor-db-migrator 1.4 7a4d871b612e 20 months ago 1.15 GB
vmware/photon 1.0 9b411d78ad9e 20 months ago 130 MB
registry.aliyuncs.com/google_containers/pause 3.1 da86e6ba6ca1 21 months ago 742 kB

给要上传的包打标签
[root@master harbor]# docker tag docker.io/mysql:latest 192.168.254.13/databases/mysql:v1
上传镜像

[root@master harbor]# docker push 192.168.254.13/databases/mysql:v1
The push refers to a repository [192.168.254.13/databases/mysql]
647229410363: Pushed
5b96d5043191: Pushed
79a46f1eb9d0: Pushed
bdebd19e878f: Pushed
995fa4bb8afe: Pushed
bb1ef34119b2: Pushed
65430c57aee2: Pushed
1dd5f3e365cf: Pushed
7f33ce1066af: Pushed
9f77b78f01a7: Pushed
f5741d086b76: Pushed
8fa655db5360: Pushed
v1: digest: sha256:f0392b61ae096aef93b25f4b88206d774d2de1a7e43a7780a59a0c319c540b79 size: 2828

浏览器查看harbor
已经上传成功,ok
补充
开启或关闭harbor:
docker-compose up -d
docker-compose stop
docker 搭建私有云仓库的更多相关文章
- docker 搭建私有云盘 Seafile
缘起 现如今各种云存储服务其实挺多的,国外有经典的DropBox.Google Drive.微软的OneDrive等,国内也有可以免费使用的各种云. 那么为什么想要搭建私有云存储呢?主要是本着“自己的 ...
- 【Docker】(4)搭建私有镜像仓库
[Docker](4)搭建私有镜像仓库 说明 1. 这里是通过阿里云,搭建Docker私有镜像仓库. 2. 这里打包的镜像是从官网拉下来的,并不是自己项目创建的新镜像,主要测试功能 一.搭建过程 首先 ...
- [转]Ubuntu18.04下使用Docker Registry快速搭建私有镜像仓库
本文转自:https://blog.csdn.net/BigData_Mining/article/details/88233015 1.背景 在 Docker 中,当我们执行 docker pull ...
- 手动搭建Docker本地私有镜像仓库
实验环境:两个Centos7虚拟机,一个是Server,用作客户端,另一个是Registry,用作Docker私有镜像仓库. 基础配置 查看一下两台虚拟机的IP地址 Server的IP地址是192.1 ...
- Docker 搭建私有仓库
Docker 搭建私有仓库 环境: docker 版本 :18.09.1 主机地址:192.168.1.79 1.运行并创建私有仓库 docker run -d \ -v /opt/registry: ...
- 菜鸟系列docker——搭建私有仓库harbor(6)
docker 搭建私有仓库harbor 1. 准备条件 安装docker sudo yum update sudo yum install -y yum-utils device-mapper-per ...
- [Docker]docker搭建私有仓库(ssl、身份认证)
docker搭建私有仓库(ssl.身份认证) 环境:CentOS 7.Docker 1.13.1 CentOS 7相关: https://www.cnblogs.com/ttkl/p/11041124 ...
- 在阿里云上搭建私有GIT仓库
在阿里云上搭建私有GIT仓库 年轻人就得好好学习,不能这么颓废 最近做项目练练手,用到了github, 但是github访问速度是真的慢啊,下载项目,下载一天了.所以呢,我是个成熟的人了,只好自己搭建 ...
- 搭建docker registry私有镜像仓库
搭建docker registry私有镜像仓库 一.安装docker-distribution yum install -y docker-distribution 安装完成后,启动服务: syste ...
随机推荐
- Android Studio上传项目到GitHub出错
上传代码到Github出错: 一.github push文件过大(超过50M会有警告,超出100M就会被限制) error: GH001: Large files detected. this exc ...
- 实践案例丨教你一键构建部署发布前端和Node.js服务
如何使用华为云服务一键构建部署发布前端和Node.js服务 构建部署,一直是一个很繁琐的过程 作为开发,最害怕遇到版本发布,特别是前.后端一起上线发布,项目又特别多的时候. 例如你有10个项目,前后端 ...
- Go | Go 语言打包静态文件以及如何与Gin一起使用Go-bindata
系列文章目录 第一章 Go 语言打包静态文件以及如何与Gin一起使用Go-bindata 目录 系列文章目录 前言 一.go-bindata是什么? 二.使用步骤 1. 安装 2. 使用 3. 读取文 ...
- .NetCore对接各大财务软件凭证API——用友系列(3)
一. 前言 由于前段时间项目比较集中,所以停更了好久,终于来到我们用友的系列产品3---U8Cloud2.7了. 一,2.7和2.5的api方式有什么区别? 1.2.7版本以后可以直接使用u8c登入地 ...
- 总结java中创建并写文件的5种方式
在java中有很多的方法可以创建文件写文件,你是否真的认真的总结过?下面笔者就帮大家总结一下java中创建文件的五种方法. Files.newBufferedWriter(Java 8) Files. ...
- centos6.8上安装部署 jhipster-registry
必备环境:jdk8,git,maven 1.安装nodejs #由于采用编译的方式很容易出现一些意外的惊喜,所以我们这儿直接用yum命令安装 #1.查看nodejs版本(命令中不要加 -y 如果版本不 ...
- Git使用感悟
前言 分支介绍 我们现在开发的分支一般是这样的(基于上面那张图片的): master:上线用的 dev:开发用的 featature_xxx:开发用的 test:测试用的 hotfix:修复bug的 ...
- 23种设计模式 - 接口隔离(Facade - Proxy - Mediator - Adapter)
其他设计模式 23种设计模式(C++) 每一种都有对应理解的相关代码示例 → Git原码 ⌨ 接口隔离 在组件构建过程中,某些接口之间直接的依赖常常会带来很多问题.甚至根本无法实现.采用添加一层间接( ...
- e3mall商城的归纳总结8之solr集群、activemq的搭建和使用
由于本节内容比较分散,因此专门为这两个技术进行开展了帖子. solr集群的搭建 solr集群solrJ的测试 activemq的搭建 activemq的使用 引入activemq.jar包 我们先来说 ...
- 你可能不了解的java枚举
枚举在java里也算个老生长谈的内容了,每当遇到一组需要类举的数据时我们都会自然而然地使用枚举类型: public enum Color { RED, GREEN, BLUE, YELLOW; pub ...