Sonatype Nexus OSS 构建私有docker 仓库

1.Docker Engine 配置

复制代码
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "dns": [
    "8.8.8.8",
    "114.114.114.114"
  ],
  "experimental": false,
  "features": {
    "buildkit": true
  },
  "insecure-registries": [
    "localhost:31182",
    "localhost:31181"
  ],
  "registry-mirrors": [
    "http://localhost:31182",
    "http://localhost:31181"
  ]
}

insecure-registries:

在 Docker 中,insecure - registries是一个配置选项,用于指定被 Docker 视为不安全的容器镜像仓库。通常情况下,Docker 默认只信任通过 HTTPS 加密通信且具有有效证书的镜像仓库,这是为了确保镜像在传输过程中的安全性。但是,在某些开发或测试环境中,可能会使用未配置 HTTPS 或者使用自签名证书的镜像仓库,此时就需要将这些仓库添加到insecure - registries列表中。

registry-mirrors:

在 Docker 中,registry - mirrors是用于配置镜像仓库镜像(Mirror)的选项。镜像仓库镜像类似于一个缓存服务器,它存储了从原始镜像仓库(如 Docker Hub)获取的容器镜像副本。这样做的主要目的是为了加速容器镜像的下载过程,特别是当从原始仓库下载速度较慢或者网络不稳定时。

  1. 2. Docker 命令
bash 复制代码
#登录
docker login localhost:31182 -u admin

#打包
docker build . -t localhost:31182/repository/docker-hosted:v1.0

#推送 
docker push  localhost:31182/repository/docker-hosted:v1.0

#拉取
docker pull localhost:31182/repository/docker-hosted:v1.0
相关推荐
木子.李34721 小时前
ssh连接远程服务器相关总结
运维·服务器·ssh
晚风吹人醒.1 天前
SSH远程管理及访问控制
linux·运维·ssh·scp·xshell·访问控制·远程管理
@LetsTGBot搜索引擎机器人1 天前
2025 Telegram 最新免费社工库机器人(LetsTG可[特殊字符])搭建指南(含 Python 脚本)
数据库·搜索引擎·机器人·开源·全文检索·facebook·twitter
DigitalOcean1 天前
DigitalOcean容器注册表推出多注册表支持功能
容器
necessary6531 天前
使用Clion查看linux环境中的PG源码
linux·运维·服务器
江湖有缘1 天前
Jump个人仪表盘Docker化部署教程:从0到 搭建专属导航页
运维·docker·容器
Lam㊣1 天前
Centos 7 系统docker:更换镜像源
linux·docker·centos
FL16238631291 天前
win11+WSL+Ubuntu-xrdp+远程桌面闪退+黑屏闪退解决
linux·运维·ubuntu
大厂技术总监下海1 天前
根治LLM胡说八道!用 Elasticsearch 构建 RAG,给你一个“有据可查”的AI
大数据·elasticsearch·开源
星浩AI1 天前
Google 官方发布:让你的 AI 编程助手"边写、边看、边调",像人类开发者一样工作
人工智能·后端·开源