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
相关推荐
wgl66652016 分钟前
Linux---基础IO!
linux·运维·服务器
Ancelin安心35 分钟前
kali-dirsearch的使用
linux·运维·服务器·python·计算机网络·web安全·网络安全
jun_bai1 小时前
python+Java的网盘程序升级版。无感知备份文档,保护数据资产利器。
运维·服务器
大厂技术总监下海1 小时前
“Today I Learned”(TIL):一种比写博客更可持续的知识沉淀习惯
大数据·开源·github
suzhou_speeder2 小时前
PoE 延长器:突破 PoE 距离限制,优化网络灵活部署方案
运维·网络·poe·poe交换机·poe延长器
—Qeyser2 小时前
Flutter GestureDetector 完全指南:让任何组件都能响应手势
flutter·云原生·容器·kubernetes
月光下的麦克2 小时前
如何查案动态库版本
linux·运维·c++
EndingCoder2 小时前
索引类型和 keyof 操作符
linux·运维·前端·javascript·ubuntu·typescript
liux35282 小时前
Web集群管理实战指南:从架构到运维
运维·前端·架构
石小千2 小时前
Linux清除缓存
linux·运维