docker安装
17年以后docker有docker-ce和dcoker-ee两个版本,ee企业版是给企业用户使用的闭源版本需要收费,ce社区版为原来的docker开源版本。
自动安装最新的docker-ce
1 |
curl -fsSL https://get.docker.com/ | sh |
安装完成之后默认没有启动docker,使用如下命令启动docker
1 |
systemctl start docker |
检查进程已正常启动
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[root@localhost ~]# docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: The Docker client contacted the Docker daemon. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ |
或者手动安装源文件后使用yum来安装
1 2 3 |
wget https://download.docker.com/linux/centos/docker-ce.repo mv docker-ce.repo /etc/yum.repos.d yum install -y docker-ce |
设置开机启动docker
1 |
systemctl enable docker |
分类: linux