二进制安装docker
【摘要】 前言本文介绍如何在centos 7下二进制安装dokcer安装docker 版本为Docker version 18.03.1-ce, build 9ee9f40。操作步骤下载解压dockerwget https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgztar -xvf docker-18.0...
前言
本文介绍如何在centos 7下二进制安装dokcer安装docker 版本为Docker version 18.03.1-ce, build 9ee9f40。
操作步骤
下载解压docker
wget https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz tar -xvf docker-18.03.1-ce.tgz
https://download.docker.com/linux/static/stable/x86_64/docker-17.03.2-ce.tgz
拷贝二进制文件到指定目录
chmod +x docker-18.03.1-ce/* cp docker-18.03.1-ce/* /usr/local/bin
生成docker.service的文件并设定到/usr/lib/systemd/system目录下
cat > /usr/lib/systemd/system/docker.service <<"EOF"[Unit] Description=Docker Application Container Engine Documentation=http://docs.docker.io [Service] Environment="PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"EnvironmentFile=-/run/flannel/docker ExecStart=/usr/local/bin/dockerd --log-level=error $DOCKER_NETWORK_OPTIONSExecReload=/bin/kill -s HUP $MAINPIDRestart=on-failure RestartSec=5 LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity Delegate=yes KillMode=process [Install] WantedBy=multi-user.target EOF systemctl restart docker # 为了多次执行可以顺利使用restartsystemctl enable docker
结果确认docker version
安装docker-compose
curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
快速安装脚本
#!/bin/bashwget https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz tar -xvf docker-18.03.1-ce.tgz chmod +x docker-18.03.1-ce/* cp docker-18.03.1-ce/* /usr/local/bin/ cat > /usr/lib/systemd/system/docker.service <<"EOF"[Unit] Description=Docker Application Container Engine Documentation=http://docs.docker.io [Service] Environment="PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"EnvironmentFile=-/run/flannel/docker ExecStart=/usr/local/bin/dockerd --log-level=error $DOCKER_NETWORK_OPTIONSExecReload=/bin/kill -s HUP $MAINPIDRestart=on-failure RestartSec=5 LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity Delegate=yes KillMode=process [Install] WantedBy=multi-user.target EOF systemctl restart docker systemctl enable docker curl -L https://get.daocloud.io/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
国内
vi /etc/docker/daemon.json
{"registry-mirrors": ["https://registry.docker-cn.com"] }
systemctl daemon-reload systemctl restart docker
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)