码迷,mamicode.com
首页 > 其他好文 > 详细

docker 本地yum源安装

时间:2018-09-21 15:23:20      阅读:737      评论:0      收藏:0      [点我收藏+]

标签:dev   url   package   本地yum   comm   rem   time   oca   客户端   

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源安装

标签:dev   url   package   本地yum   comm   rem   time   oca   客户端   

原文地址:http://blog.51cto.com/11578535/2178129

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!