centos7下docker二进制安装
问题描述:
内网离线环境下,安装docker.二进制来的还是快点,或者内网搭建yum的epel仓库!
环境:
centos7.x
docker-18.9.0 x86_64 static //二进制
解决方法:
1、download:
https://download.docker.com/linux/static/stable/x86_64/
2、kernel ack
[root@lab-210 ~]# uname -r //kerner3.10.+ centois7.x 内核都是3.10+,此举只是为了验证
3.10.0-862.el7.x86_64
3、setup
docker-18.06.1-ce.tgz
tar zxf docker-18.06.1-ce.tgz && mv docker/* /usr/bin/ && rm -rf docker*.tgz //解压切移动binary到 /usr/bin
注意:如果移动到别的目录有点问题,systemctl脚本启动不起来,具体原因还在寻找中
4、systemd docker.service
vim /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target [Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s [Install]
WantedBy=multi-user.target
5、grant privilege
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload //重载systemd下 xxx.service文件
systemctl start docker //启动Docker
systemctl enable docker.service //设置开机自启
6、testing docker
systemctl status docker //查看Docker状态
docker -v //查看Docker版本
附录centos7.x安装脚本 install.sh
#!/bin/bash
set -x #var
unamer=`uname -r |cut -d'.' -f1-2` #kernel 3.10+
if [[ $unamer -lt 3.10 ]];then
echo "the linux kernel too lower" && exit 8
fi #setup
tar zxf docker-18.06.1-ce.tgz && mv docker/* /usr/bin/ && rm -rf docker* #systemd config
cat >/etc/systemd/system/docker.service <<-EOF
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target [Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s [Install]
WantedBy=multi-user.target
EOF #start
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload && systemctl start docker && systemctl enable docker.service #testing
systemctl status docker && docker -v
centos7下docker二进制安装的更多相关文章
- centos7下docker的安装教程
Centos7下docker安装教程以及踩过的那些坑 推荐在Centos下安装docker,在windows下安装docker可能会遇到很多的问题,而且docker官方推荐使用linux环境来使用do ...
- CentOS7下Docker的安装与使用
前言 简介 Docker 是一个开源的应用容器引擎,基于 Go 语言,并遵从 Apache2.0 协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到 ...
- [转]Centos7下caffe的安装
Centos7下caffe的安装 原文地址:http://blog.csdn.net/s2392735818/article/details/49796017 版权声明:本文为博主原创文章,未经博 ...
- CentOS6下docker的安装和使用
CentOS6下docker的安装和使用 Docker是一个开源的应用容器引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.利用Linux的LXC.AUFS.Go语言.cgroup ...
- CentOS6.5下docker的安装及遇到的问题和简单使用(已实践)
转载自 CentOS6下docker的安装和使用 Docker是一个开源的应用容器引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.利用Linux的LXC.AUFS. Go语言.c ...
- centos7下使用yum安装mysql
CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 wget http://repo.mysql.com/m ...
- centos7下搜狗输入法的安装教程
相信用过centos自带的输入法的朋友都会感叹这也实在是太难用了吧,使用拼音打出来的词总是不能在前几个匹配到,即使是一些常用词也是如此,简直无法忍受跟个zz似的.吐槽完了,这里给出centos7下搜狗 ...
- centos7下使用yum安装pip
centos7下使用yum安装pip 首先安装epel扩展源: yum -y install epel-release 更新完成之后,就可安装pip: yum -y install python-pi ...
- Centos7 下的SVN安装与配置
Centos7 下的SVN安装与配置 1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临 ...
随机推荐
- 组合数的简单求法(dfs)
组合数的具体应用可以参考这个例子:https://www.cnblogs.com/FengZeng666/p/10496223.html 下面这段代码可以作为求组合数的固定套路或者公式: #inclu ...
- Jenkins使用遇到的问题总结
学新技能最方便的就是在网上找教程了,我找到一个还不错的易百教程 Jenkins教程 别看教程写了一堆,其实真正用到的没多少.后面的自动化测试,服务器维护啥的,等用到的时候再深入研究吧 No1: 按照教 ...
- Nowcoder contest 392 I 逛公园 (无向图割边模板)
<题目链接> 题目描述: 月月和华华一起去逛公园了.公园很大,为了方便,可以抽象的看成一个N个点M条边的无向连通图(点是景点,边是道路).公园唯一的入口在1号点,月月和华华要从这里出发,并 ...
- POJ 1330 Nearest Common Ancestors (模板题)【LCA】
<题目链接> 题目大意: 给出一棵树,问任意两个点的最近公共祖先的编号. 解题分析:LCA模板题,下面用的是树上倍增求解. #include <iostream> #inclu ...
- Codeforces Gym 101291C【优先队列】
<题目链接> 题目大意: 就是一道纯模拟题,具体模拟过程见代码. 解题分析:要掌握不同优先级的优先队列的设置.下面是对优先队列的使用操作详解: priority_queue<int& ...
- 从零搭建 ES 搜索服务(三)同义词搜索
一.前言 上篇介绍了 ES 的基础搜索,能满足我们基本的需求,然而在实际使用中还可能希望搜索「番茄」能将包含「西红柿」的结果也罗列出来,本篇将介绍如何实现同义词之间的搜索. 二.安装 ES 同义词插件 ...
- shell delete with line number
If you want to delete lines 5 through 10 and 12: sed -e '5,10d;12d' file This will print the results ...
- vim编辑
vim 重点在于光标的移动,模式的切换,删除,查找,替换,复制,黏贴,撤销命令的使用 vim的三种模式:命令模式(打开文件默认进入此模式)编辑模式(输入模式)末行模式(按:键进入,只能从命令模式下按键 ...
- 大数据 时间同步问题 解决hbase集群节点HRegionServer启动后自动关闭
1)在hbase-site.xml文件中 修改增加 ,将时间改大点<property><name>hbase.master.maxclockskew</name>& ...
- CCF-学生排队
PS:此文章已在我的站点更新,请移步访问~更多注释讲解哦.https://www.jeson.xin/ccf-student_queuing.html