docker Setup
docker推荐使用version 1.13或者更高版本
docker 包含社区版和企业版 Community Edition (CE) and Enterprise Edition (EE).
支持多种平台
DeskTop:Mac、Windows
Cloud:Amazon 、Microsoft
Server:CentOs、OracleLinux、Ubuntu、Debian、Red Hat Enterprise Linux
安装docker CE
启动一个docker CE,需要确认前置要求,再执行安装操作。EE版本是收费版本不做介绍
前置要求
OS要求、老版本要求:docker docker-engine查看
安装
-
Install required packages.
yum-utils
provides theyum-config-manager
utility, anddevice-mapper-persistent-data
andlvm2
are required by thedevicemapper
storage driver.$ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
-
Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well.
$ sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
-
Optional: Enable the edge and test repositories. These repositories are included in the
docker.repo
file above but are disabled by default. You can enable them alongside the stable repository.$ sudo yum-config-manager --enable docker-ce-edge
$ sudo yum-config-manager --enable docker-ce-test
You can disable the edge or test repository by running the
yum-config-manager
command with the--disable
flag. To re-enable it, use the--enable
flag. The following command disables the edge repository.$ sudo yum-config-manager --disable docker-ce-edge
Install the latest version of Docker CE, or go to the next step to install a specific version.
$ sudo yum install docker-ce
-
Start Docker.
$ sudo systemctl start docker
-
Verify that
docker
is installed correctly by running thehello-world
image.$ sudo docker run hello-world
2.下载rpm,手动安装
从这下载
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
Install Docker CE, changing the path below to the path where you downloaded the Docker package.
$ sudo yum install /path/to/package.rpm
3.scripts脚本自动安装
4.卸载
-
Uninstall the Docker package:
$ sudo yum remove docker-ce
-
Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
$ sudo rm -rf /var/lib/docker
You must delete any edited configuration files manually.