docker 本地yum源安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker 本地yum源安装相关的知识,希望对你有一定的参考价值。
1、准备docker软件包
$ sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum-config-manager --enable docker-ce-edge
$ yum install --downloadonly --downloaddir=/home/work/repo/docker-ce docker-ce
2、配置yum源
$ yum install createrepo
$ createrepo -d /home/work/repo/docker-ce/
3、配置nginx
$ cat /usr/local/nginx/conf/vhost/server/package.conf
server {
listen 80;
server_name yum.serve;
server_name public.serve;
server_name package.wcj.me;
access_log /usr/local/nginx/logs/share.access.log ;
error_log /usr/local/nginx/logs/share.error.log;
location / {
root /home/work;
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
}
}
$ nginx -t
$ nginx -s reload
4、客户端配置(添加)
$ vim /etc/yum.repos.d/CentOS-Base.repo
[docker-ce]
name=18.06.1.ce-3.el7
baseurl=http://yum.serve/repo/docker-ce
enabled=1
priority=99
gpgcheck=0
$ $ sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine
$ sudo yum install -y device-mapper-persistent-data lvm2
$ yum install docker-ce
以上是关于docker 本地yum源安装的主要内容,如果未能解决你的问题,请参考以下文章
Centos7.2 Redhat7.2 离线安装docker