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
相关推荐
xqhoj3 分钟前
Linux——make、makefile
linux·运维·服务器
文亭湖畔程序猿18 分钟前
Debian 12 日常命令 & nano 快捷键速查表
运维·debian
张童瑶20 分钟前
Linux 在线安装编译Python3.11
linux·运维·python3.11
ziqibit24 分钟前
debian Live with Persistence 持久化U盘的debian系统
运维·debian
Shi_haoliu30 分钟前
SolidTime 在 Rocky Linux 9.5 上的完整部署流程
linux·运维·nginx·postgresql·vue·php·laravel
HIT_Weston2 小时前
100、【Ubuntu】【Hugo】搭建私人博客:元信息&翻译(一)
linux·运维·ubuntu
C_心欲无痕2 小时前
Docker 的镜像与容器
运维·docker·容器
Mr. Cao code2 小时前
Docker匿名数据卷实战指南
运维·ubuntu·docker·容器
Blossom.1182 小时前
AI Agent的长期记忆革命:基于向量遗忘曲线的动态压缩系统
运维·人工智能·python·深度学习·自动化·prompt·知识图谱
HehuaTang3 小时前
requests 调大并对齐 limits 提升POD高负载场景下性能
java·docker·kubernetes