docker 官网:
https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements
1 先卸载系统上已经存在docker,卸载旧版本的
yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine
2 安装docker:
yum install -y yum-utils
device-mapper-persistent-data
lvm2
sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce
3 启动docker server sudo systemctl start docker sudo docker version 4 Verify that docker is installed correctly by running the hello-world image. sudo docker run hello-world
5 more Vagrantfile config.vm.provision "shell" , inline: <<-SHELL apt-get update apt-get install -y apache2 SHELL 在机器启动以后,自动运行一些命令,比如自动安装一些软件
查看image 列表 sudo docker image ls
image 获取1
image 获取2 sudo docker pull ubuntu:14.04 docke pull ubuntu 不加版本号,默认拉取最新版 如 docker pull bitnami/wordpress