要测试dirtycow,环境要求严格,首先下载了ubuntu12.04版本,然后内核更新到3.10之上,3.13之下。
下载地址参考:
http://www.downyi.com/downinfo/223253.html
对应该更新到哪个版本内核,参照。
1.ubuntu镜像源
清华大学镜像源地址如下,进去找对应版本更改/etc/apt/source.list更新
清华大学ubuntu镜像源
------------分割线
更新2021/04/07
今天在ubuntu12.04上安装Docker死活安装不上,不管怎么换12.04的源都不行,后来直接换为14.04的阿里云源,就行了。
附上阿里云的源
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
--------分割线至
2.Depends: init-system-helpers (>= 1.18~)
解决方案:
wget http://launchpadlibrarian.net/173841617/init-system-helpers_1.18_all.deb
dpkg -i init-system-helpers_1.18_all.deb
3.指定版本
如还要测runc漏洞,Docker版本应在18之下
#有部分网站所安装precise docker要3.13内核,本人3.12成功安装。
#列出可用的
apt-cache madison docker-ce
#安装
sudo apt-get install docker-ce=<VERSION>
比如:
sudo apt-get install docker-ce=18.06.1~ce~3-0~ubuntu
4.内核版本低于3.10
wget kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.15-trusty/linux-headers-3.12.15-031215_3.12.15-031215.201403260835_all.deb
wget kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.15-trusty/linux-headers-3.12.15-031215-generic_3.12.15-031215.201403260835_amd64.deb
wget kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.15-trusty/linux-image-3.12.15-031215-generic_3.12.15-031215.201403260835_amd64.deb
sudo dpkg -i linux-image-3.12*.deb linux-headers-3.12*.deb
#如果安装有问题,哪个不对就重新wget下一次
测试环境成功搭建
5.容器内ubuntu换源
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list