1.安装指南:https://docs.docker.com/engine/installation/linux/ubuntulinux/
1.安装 linux-image-extra-* kernel packages
$ sudo apt-get update
$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
2.安装docker-engine
$ uname -r
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
创建docker.list文件
$ sudo vi /etc/apt/sources.list.d/docker.list
添加内容:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
保存文件,并执行以下操作
$ sudo apt-get update
$ sudo apt-get purge lxc-docker
$ apt-cache policy docker-engine
$ sudo apt-get upgrade
2.启动Docker --- 后台运行
Docker只能root或名为docker的组内用户操作
1.启动 sudo service docker start
2.关闭 sudo service docker stop
3.搜索并拉取公共镜像 image
docker search image_name
sudo docker pull image_name
4.运行Docker程序
eg:
sudo docker pull hello-world
sudo docker run hello-world
1.安装 linux-image-extra-* kernel packages
$ sudo apt-get update
$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
2.安装docker-engine
$ uname -r
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
创建docker.list文件
$ sudo vi /etc/apt/sources.list.d/docker.list
添加内容:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
保存文件,并执行以下操作
$ sudo apt-get update
$ sudo apt-get purge lxc-docker
$ apt-cache policy docker-engine
$ sudo apt-get upgrade
2.启动Docker --- 后台运行
Docker只能root或名为docker的组内用户操作
1.启动 sudo service docker start
2.关闭 sudo service docker stop
3.搜索并拉取公共镜像 image
docker search image_name
sudo docker pull image_name
4.运行Docker程序
eg:
sudo docker pull hello-world
sudo docker run hello-world