手动安装
- 添加代码
vim /etc/apt/sources.list.d/backports.list
加入:deb http://http.debian.net/debian wheezy-backports main
然后刷新: apt-get update
- 添加https方法和CA cerificates
apt-get install apt-transport-https ca-certificates
- 添加GPG key
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- 文件编辑
vim /etc/apt/sources.list.d/docker.list
deb https://apt.dockerproject.org/repo debian-wheezy main
刷新源:apt-get update
- 开始安装
apt-get install docker-engine
- 启动服务
service docker start
docker run hello-world //进行验证
- 常用命令
docker version 查看版本信息
docker images 查看我们拥有了的images
docker ps -a 查看docker container
docker stop [container ID] 停止镜像
docker start [container ID] 启动镜像
docker exec -it [container ID] /bin/bash 进入镜像内部
- 镜像删除
先删除容器:docker rm [container ID]
再删除镜像:docker rmi [images ID]
apt安装
apt-get install docker docker-compose //等待安装
reboot //重启才能生效