昂达官网首页(Dcoker部署Nexus3 私有仓库配置ssl访问)
用户投稿
•
•
阅读 133
昂达官网首页:使用 Docker 官方的 Registry 创建的仓库面临一些维护问题。比如某些镜像删除以后空间默认是不会回收的,需要一些命令去回收空间然后重启 Registry。在企业中把内部的一些工具包放入 Nexus 中是比较常见的做法,最新版本 Nexus3.x 全面支持 Docker 的私有镜像。所以使用 Nexus3.x 一个软件来管理 Docker、Maven、Yum、PyPI 等是一个明智的选择。

私有仓库当中会存放大量Dcoker镜像等内容,会占用大量的空间。因此实现因考虑是否有必要挂载一块磁盘,避免后期磁盘空间的不足,挂载磁盘操作这里不再赘述。
1、使用docker-compose部署
[root@localhost ~]# mkdir -p /srv/nexus/nexus-compose/
[root@localhost ~]# mkdir -p /srv/nexus/data
[root@localhost ~]# chown 200 -R /srv/nexus/data/
[root@localhost ~]# vim /srv/nexus/nexus-compose/docker-compose.yml
version: '3'
services:
nexus3:
restart: always
image: sonatype/nexus3:3.33.1
ports:
- 10.11.10.4:8081:8081
volumes:
- /srv/nexus/data:/nexus-data
[root@localhost ~]# cd /srv/nexus/nexus-compose/
[root@localhost nexus-compose]# docker-compose up -d
2、配置Nginx代理
[root@localhost ~]# cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/nexus.conf
[root@localhost ~]# vim /etc/nginx/conf.d/nexus.conf
upstream nexus_website {
server 10.11.10.4:8081;
}
upstream nexus_docker_hosted {
server 10.11.10.4:18081;
}
upstream nexus_docker_group {
server 10.11.10.4:18082;
}
server {
listen 443 ssl http2;
listen 80;
server_name nexus.inboc.net;
ssl_certificate /etc/nginx/cert/6172143_nexus.inboc.net.pem;
ssl_certificate_key /etc/nginx/cert/6172143_nexus.inboc.net.key;
client_max_body_size 10G;
location / {
proxy_pass http://nexus_website;
proxy_set_header Host host;
proxy_set_header X-Real-IPremote_addr;
proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto "https";
}
}
server {
listen 443 ssl http2;
listen 80;
server_name repo.inboc.net;
ssl_certificate /etc/nginx/cert/6174303_repo.inboc.net.pem;
ssl_certificate_key /etc/nginx/cert/6174303_repo.inboc.net.key;
client_max_body_size 10G;
chunked_transfer_encoding on;
setupstream "nexus_docker_hosted";
if ( request_method ~* 'GET') {
setupstream "nexus_docker_group";
}
if (request_uri ~ '/search') {
setupstream "nexus_docker_hosted";
}
location / {
proxy_pass http://upstream;
proxy_set_header Hosthost;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
proxy_set_header X-Real-IP remote_addr;
proxy_buffering off;
proxy_request_buffering off;
proxy_set_header X-Forwarded-Forproxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
}
}
3、集成LDAP
| 字段 | 内容 |
|---|---|
| Name | AD |
| LDAP server address | ldap://10.11.10.1:389 |
| Search Base DN | ou=linuxer,dc=inboc,dc=net |
| Authentication method | Simple Authenticaition |
| Username or DN | Administrator@linuxer.org |
| Password | |
| Conflguration template | Active Directory |
| User relative DN | 空 |
| User filter | (&(|(objectclass=person))(|(memberof=CN=运维,OU=运维,OU=Linuxer,DC=linuxer,DC=org))) |
4、映射AD组
点击“Role”→“Create role”,如下图所示:
其他保持默认即可。
随机文章
SEO教程友情链接交换
关键词排名优化
网站内容优化
站长导航
友情链接交换
搜素引擎算法
关键词排名优化
百度搜索“网赚联盟”即可找到本站,微信搜索“小小课堂网”关注小小课堂网公众号。网赚联盟( wangzhuan.org.cn )欢迎用户投稿,发布者:用户投稿,文章版权归作者所有,投稿文章不代表网赚联盟立场,中二少年发布为网赚联盟原创文章,转载请注明出处:https://wangzhuan.org.cn/25005.html

微信扫一扫
支付宝扫一扫