配置docker-ce源
这里也是以阿里云的docker-ce源为例。
源地址为:https://mirrors.aliyun.com/docker-ce/linux/centos
1、在nexus上配置代理
- Nexus上创建Blob Stores
- 创建Repositories
点击设置 - -> Repositories -- > Create repository --> yum(proxy)进入到以下界面。
第四步填入阿里云的docker-ce源地址
第五步选择刚创建storage
Blob store选择第一张图配置的 docker-ce
2、目标机器上配置docker-ce源
- 登录到机器
以下针对的是centos的操作系统
进入/etc/yum.repos.d/
- 备份或新建docker-ce.repo
备份旧的docker-ce.repo
$ sudo mv docker-ce.repo docker-ce.repo.bak
- 下载源地址下 docker-ce.repo 和 gpg文件到 /etc/yum.repos.d/ 目录下
- 编辑docker-ce.repo文件
复制代理连接过来:http://ip:port/repository/docker-ce-proxy/
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/source/stable
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-test-debuginfo]
name=Docker CE Test - Debuginfo $basearch
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/debug-$basearch/test
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/source/test
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-nightly]
name=Docker CE Nightly - $basearch
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-nightly-debuginfo]
name=Docker CE Nightly - Debuginfo $basearch
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/debug-$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
[docker-ce-nightly-source]
name=Docker CE Nightly - Sources
baseurl=http://ip:port/repository/decker-ce-proxy/$releasever/source/nightly
enabled=0
gpgcheck=1
gpgkey=file:///etc/yum.repos.d/gpg
- 清理缓存
$ yum clean all
$ yum makecache