内容目录
参考文章
https://blog.csdn.net/weixin_40308031/article/details/123049636
离线安装包下载地址
链接: https://pan.baidu.com/s/1_KXJfsIvatA3NH_IlTCzng?pwd=hkj8 提取码: hkj8
文件列表
├── device-mapper-libs │ ├── device-mapper-1.02.117-12.el6.x86_64.rpm │ ├── device-mapper-event-1.02.117-12.el6.x86_64.rpm │ ├── device-mapper-event-libs-1.02.117-12.el6.x86_64.rpm │ ├── device-mapper-libs-1.02.117-12.el6.x86_64.rpm │ ├── lvm2-2.02.143-12.el6.x86_64.rpm │ └── lvm2-libs-2.02.143-12.el6.x86_64.rpm ├── docker-io-1.7.1-2.el6.x86_64.rpm ├── libcgroup-0.40.rc1-23.el6.x86_64.rpm ├── lua-alt-getopt-0.7.0-1.el6.noarch.rpm ├── lua-filesystem-1.4.2-1.el6.x86_64.rpm ├── lua-lxc-1.0.10-2.el6.x86_64.rpm ├── lxc-1.0.10-2.el6.x86_64.rpm └── lxc-libs-1.0.10-2.el6.x86_64.rpm
如果服务器有旧版本device-mapper-libs请卸载,无则忽略,不然后续无法安装上面的device-mapper-libs-1.02.117-12.el6.x86_64.rpm
命令查询
rpm -qa|grep device-mapper-libs
比如我的是79版本,如果你是117版本或者更高略过
yum remove device-mapper-libs-1.02.79-8.el6.x86_64
不卸载的话 后续docker -d会提示
docker: relocationerror: docker: symbol dm_task_get_info_with_deferred_remove, version Base notdefined in file libdevmapper.so.1.02 with link time reference
然后开始正式安装
将压缩包解压 docker 目录上传至任意目录,我个人传到了/usr/local/src/
然后执行
cd /usr/local/src/docker rpm -ivh lxc-libs-1.0.10-2.el6.x86_64.rpm rpm -ivh lua-alt-getopt-0.7.0-1.el6.noarch.rpm rpm -ivh lua-filesystem-1.4.2-1.el6.x86_64.rpm rpm -ivh lua-lxc-1.0.10-2.el6.x86_64.rpm rpm -ivh lxc-1.0.10-2.el6.x86_64.rpm rpm -ivh docker-io-1.7.1-2.el6.x86_64.rpm
然后继续安装
cd /usr/local/src/docker/device-mapper-libs/ rpm -ivh device-mapper-1.02.117-12.el6.x86_64.rpm rpm -ivh device-mapper-event-1.02.117-12.el6.x86_64.rpm rpm -ivh device-mapper-event-libs-1.02.117-12.el6.x86_64.rpm rpm -ivh device-mapper-libs-1.02.117-12.el6.x86_64.rpm rpm -ivh lvm2-2.02.143-12.el6.x86_64.rpm rpm -ivh lvm2-libs-2.02.143-12.el6.x86_64.rpm
然后docker就离线安装完了,如果是国内服务器,拉镜像太慢,修改镜像源
我是改为https://xxxxx.mirror.aliyuncs.com
具体地址,你可以上自己的阿里云账号获取
参考我另一篇centos7 改镜像源
或者使用网易的也行http://hub-mirror.c.163.com
以下为编辑内容
vi /etc/sysconfig/docker # /etc/sysconfig/docker # # Other arguments to pass to the docker daemon process # These will be parsed by the sysv initscript and appended # to the arguments list passed to docker -d other_args="registry-mirrors”:“https://xxxxx.mirror.aliyuncs.com" DOCKER_CERT_PATH=/etc/docker # Resolves: rhbz#1176302 (docker issue #407) DOCKER_NOWARN_KERNEL_VERSION=1 # Location used for temporary files, such as those created by # # docker load and build operations. Default is /var/lib/docker/tmp # # Can be overriden by setting the following environment variable. # # DOCKER_TMPDIR=/var/tmp
启动docker
nohup docker -d >/dev/null 2>&1 &
后面发现修改/etc/sysconfig/docker无效,拉取镜像报错
Error: Status 410 trying to pull repository bitnami/mysql: "<html>\r\n<head><title>410 Gone</title></head>\r\n<body>\r\n<center><h1>410 Gone</h1></center>\r\n<hr><center>openresty</center>\r\n</body>\r\n</html>\r\n"
参数化启动指定镜像源数据目录
nohup docker -d --registry-mirror=https://xxxxx.mirror.aliyuncs.com -g /data/docker >/dev/null 2>&1 &
大功告成 留文备忘
1 comment on centos6.5 离线安装docker1.7.1(带离线安装包下载)