1.Debian9
step1:卸载老版本docker,如果之前没有安装docker,可以跳过
apt-get remove docker docker-engine docker.io
step2:安装docker需要的相关软件
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
step3:安装docker官方的GPG证书
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
step4:添加docker更新源
add-apt-repository deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable
step5:更新软件信息
apt-get update
step6:安装docker
apt-get install docker-ce
step7:下载docker镜像(由于宝塔面板是在centos下研发的,对centos的支持也是最好的,所以我下载的是centos的镜像文件)
docker pull centos
step8:运行镜像
docker run -d --name bt-panel-e -p 21:21 -p 2222:22 -p 80:80 -p 443:443 -p 888:888 -p 3306:3306 -p 8888:8888 -it registry.cn-xxx.xxx.com/bt-panel-e:0.1 /bin/bash
(我这是连接的宝塔集成开发环境)
step9:启动面板服务
docker exec bt-panel-e /etc/init.d/bt start
step10:验证面板是否启动
浏览器地址栏输入:服务器地址:8888
(本机为 127.0.0.1:8888)
2.CentOS安装过程(CentOS7)
step1:配置yum源
CentOS7:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS6:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
step2:生成缓存
yum makecache
step3:安装docker
yum -y install docker-engine-1.13.1
step4:启动并设为开机自启
systemctl start docker
systemctl enable docker
后续步骤同1。