FW nexus docker
原文地址: http://www.cnblogs.com/wzy5223/p/5410990.html
Nexus 3.0 可以创建三种docker仓库:
1. docker (proxy) 代理和缓存远程仓库 ,只能pull
2. docker (hosted) 托管仓库 ,私有仓库,可以push和pull
3. docker (group) 将多个proxy和hosted仓库添加到一个组,只访问一个组地址即可,只能pull
一. 配置Nexus 3.0
经过测试, Nexus必须启动https,否则只能通过localhost登陆,hosted仓库也不能push。https证书可以到CA购买,也可以用自签名证书。
首先配置JVM1.8 ,下载安装Nexus 3.0,nexus-3.0.0-03-unix.tar.gz 。(下载需要代理,我已经上传到云盘:http://pan.baidu.com/s/1eRZesQe)
解压压缩包以后,切换到解压目录,运行下面的命令就能启动
./bin/nexus run 或者 ./bin/nexus start
在启动之前需要先修改配置文件: (红色字体)
1. 开启监听ssl协议端口

cat > etc/org.sonatype.nexus.cfg <<EOF
# Jetty section
application-port-ssl=8443
application-port=8081
application-host=0.0.0.0
nexus-args=${karaf.etc}/jetty.xml,${karaf.etc}/jetty-http.xml,${karaf.etc}/jetty-requestlog.xml,${karaf.etc}/jetty-https.xml,${karaf.etc}/jetty-http-redirect-to-https.xml
nexus-context-path=/ # Nexus section
nexus-edition=nexus-oss-edition
nexus-features=\
nexus-oss-feature
EOF

2. 生成证书秘钥

NEXUS_DOMAIN=nexus 没有可以随便写
NEXUS_IP_ADDRESS=192.168.31.135 你的IP mkdir etc/ssl
cd etc/ssl
keytool -genkeypair -keystore keystore.jks -storepass nexus3 -keypass nexus3 -alias jetty -keyalg RSA -keysize 2048 -validity 5000 -dname "CN=*.${NEXUS_DOMAIN}, OU=Example, O=Sonatype, L=Unspecified, ST=Unspecified, C=US" -ext "SAN=DNS:${NEXUS_DOMAIN},IP:${NEXUS_IP_ADDRESS}" -ext "BC=ca:true"

3. 修改etc/jetty-https.xml ,红色字体
<Set name="KeyStorePath"><Property name="karaf.etc"/>/ssl/keystore.jks</Set>
<Set name="KeyStorePassword">nexus3</Set>
<Set name="KeyManagerPassword">nexus3</Set>
<Set name="TrustStorePath"><Property name="karaf.etc"/>/ssl/keystore.jks</Set>
<Set name="TrustStorePassword">nexus3</Set>
4. 启动Nexus3.0
./bin/nexus run
5. 在运行docker的机器上信任nexus的证书, ubuntu系统
keytool -printcert -sslserver ${NEXUS_IP_ADDRESS}:8443 -rfc >nexus.crt
sudo mv nexus.crt /usr/local/share/ca-certificates/nexus.crt
sudo update-ca-certificates
6. 重启docker
sudo service docker restart
二. 创建docker代理仓库, docker (proxy)
访问Nexus的主页,https://192.168.31.135:8443 ,(注,自签名证书需要在浏览器将地址添加到白名单,访问http协议的8081端口会自动跳转)
用管理员登陆,用户名/密码 : admin/admin123,创建docker (proxy)仓库,内容如下面修改:
Name: docker
HTTPS: 8888
Enable Docker V1 API: true 勾选下面的复选框
Remote storage: https://registry-1.docker.io
Docker Index: Use Docker Hub
Blob store: default

修改完成以后登陆代理仓库, 用户名密码: admin/admin123
docker login ${NEXUS_IP_ADDRESS}:8888
然后可以用下面的命令搜索和下载docker镜像
docker search ${NEXUS_IP_ADDRESS}:8888/hello-world
docker pull ${NEXUS_IP_ADDRESS}:8888/hello-world
下载成功以后,可以看到hello-world镜像已经缓存在nexus上了,其它机器再次下载速度就会快很多。

FW nexus docker的更多相关文章
- nexus docker 私有镜像处理
新版本的nexus 可以进行docker 镜像的存储处理 配置私有镜像(host 模式) 修改docker 非安全镜像处理 { "registry-mirrors": [" ...
- docker nexus oss
docker login/search x.x.x.x:8081 sonatype/docker-nexus Docker images for Sonatype Nexus with the Ora ...
- docker --Nexus仓库
Nexus 简介 Nexus 是个仓库管理器,目前主要分2大版本:2.X 和 3.X.2.X 主要支持的格式是Maven.P2.OBR.Yum.3.X主要支持的是Docker.NuGet.npm.Bo ...
- 用Docker搭建Nexus私服
搜索Nexus 在docker容器中加载Nexus镜像 发布本地项目到Nexus私服 配置连接方式 发布指令 打源码包上传插件 搜索Nexus 在我们打算使用Nexus时,我们先搜索一下docke ...
- dubbo循序渐进 - 使用Docker安装Nexus
docker search nexus docker pull docker.io/sonatype/nexus3 mkdir -p /usr/local/nexus3/nexus-data /usr ...
- 使用Nexus搭建私有Nuget仓库
前言 Nuget是ASP .NET Gallery的一员,是免费.开源的包管理工具,专注于在.Net / .Net Core应用开发过程中第三方组件库的管理,相对于传统单纯的dll引用要方便.科学得多 ...
- CentOS docker 常用命令
yum install docker 安装服务 systemctl start docker.service 启动服务 systemctl enable docker.service 开机启动服务 d ...
- Docker 系列四(自定义仓库).
一.Docker hub 交互 Docker hub 是 Docker 官方维护的一个公共仓库,大部分需求都可以通过在 Docker hub 中直接下载镜像来完成.接下来,来看一下怎么与 Docker ...
- Docker初次使用与安装过程
Docker入门 Docker 简介 Docker有两个版本: 社区版(CE) 企业版(EE) Docker Community Edition(CE)非常适合希望开始使用Docker并尝试使用基于容 ...
随机推荐
- H5开发之Eclipes 编码乱码问题
1.编码不对 a.对某文件或某工程更改编码: 鼠标移到工程名或文件名,右键->Properties->Resource->Text file enCoding ->更改编码(G ...
- push和join
Push,向数组末尾添加元素,并返回长度. Join,将数组按照join参数连接起来. 不同浏览器对JS解析不同,Join比连接字符串快,要用大量数据测试,然后比时间.
- 简单几何(半平面交+二分) LA 3890 Most Distant Point from the Sea
题目传送门 题意:凸多边形的小岛在海里,问岛上的点到海最远的距离. 分析:训练指南P279,二分答案,然后整个多边形往内部收缩,如果半平面交非空,那么这些点构成半平面,存在满足的点. /******* ...
- Courses
Courses Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total S ...
- BZOJ2388 : 旅行规划
考虑分块,每块维护两个标记$ts,td$. 那么对于块中一个位置$i$,它的实际值为$i\times td+ts+v_i$. 修改的时候,对于整块,直接打标记,对于零散的暴力修改,然后重构凸壳,时间复 ...
- BZOJ4311 : 向量
考虑离线操作,求出每个向量存在的时间区间,用时间线段树来进行分治,在每个节点求出凸壳后,询问时在凸壳上三分答案.时间复杂度$O(n\log^2n)$. #include<cstdio> # ...
- BZOJ3642 : [CEOI 2014] Cake
rank[i]表示第i美味的是哪块 left[i]表示在k左边美味度为i的是哪块 right[i]表示在k右边美味度为i的是哪块 用3棵线段树分别维护d序列的区间最大值.left序列的区间最大值.ri ...
- slice、substring和substr
首先,他们都接收两个参数,slice和substring接收的是起始位置和结束位置(不包括结束位置),而substr接收的则是起始位置和所要返回的字符串长度.直接看下面例子: 1 var tes ...
- (转)js:字符串(string)转json
第一种方式: 使用js函数eval(); testJson=eval(testJson);是错误的转换方式. 正确的转换方式需要加(): testJson = eval("(" + ...
- C#时间格式化(Datetime)用法详解
Datetime.ToString(String, IFormatProvider) 参数format格式详细用法: 格式字符 关联属性/说明 d ShortDatePattern D LongDat ...