想快速装好docker和docker-compose ?那就随本文用一次复制粘贴来完成安装:

环境信息

  1. 操作系统:CentOS Linux release 7.7.1908 (Core,
  2. 操作账号:root
  3. Docker版本:当前最新版本:19.03.2
  4. docker-compose版本:当前最新版本:1.24.1

安装

执行以下命令(若非root账号,请自行添加sudo):

yum install -y yum-utils device-mapper-persistent-data lvm2 \
&& yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo \
&& yum install -y docker-ce docker-ce-cli containerd.io \
&& systemctl start docker \
&& yum -y install epel-release \
&& yum -y install python-pip \
&& pip install --upgrade pip \
&& pip install docker-compose

等待几分钟,即完成docker和docker-compose的安装

验证

  1. docker版本:
[root@centos7 ~]# docker version
Client: Docker Engine - Community
Version: 19.03.2
API version: 1.40
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:28:55 2019
OS/Arch: linux/amd64
Experimental: false Server: Docker Engine - Community
Engine:
Version: 19.03.2
API version: 1.40 (minimum version 1.12)
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:27:34 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683
  1. docker-compose版本:
[root@centos7 ~]# docker-compose version
docker-compose version 1.24.1, build 4667896
docker-py version: 3.7.3
CPython version: 2.7.5
OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017
  1. 运行hello world:
[root@centos7 ~]# docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:b8ba256769a0ac28dd126d584e0a2011cd2877f3f76e093a7ae560f2a5301c00
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:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. 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/

操作完成,希望这一次复制粘贴能助您快速开启docker之旅。

最新文章

  1. ios 弹出不同的键盘
  2. Linux终端杀手、程序员利器-Tmux
  3. React Native 开发之 (04) 例子讲解
  4. Configuration
  5. CentOS7之VMware安装
  6. Grand Central Dispatch (GCD)
  7. yepnope初体验
  8. DateTime.TryParseExact 万能时间格式转化
  9. hdu1712(分组背包)
  10. launch failed.Binary not found
  11. mysql的基本使用命令
  12. Web Application Security(Web应用安全)
  13. C#获取一个实体类的属性名称、属性值
  14. (zhuan) 126 篇殿堂级深度学习论文分类整理 从入门到应用
  15. POJ1417 True Liars
  16. protobuf GetExtension
  17. 用dockerfile构建基于centos系统的jar包的镜像
  18. web问题
  19. 【Hibernate】Hibernate3.x独立执行时的Failed to load class "org.slf4j.impl.StaticLoggerBinder"错误
  20. jquery.validate ajax方式验证

热门文章

  1. Ms Sql server 主键并发冲突解决办法
  2. 设计模式(C#)——08组合模式
  3. ValueError: Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (60000, 28, 28)
  4. NLP(十五) 聊天机器人
  5. 牛客第五场 G max 思维
  6. Halloween treats HDU 1808 鸽巢(抽屉)原理
  7. 关于C语言\b \t \n及转义序列的理解
  8. 关闭Linux(Ubuntu)错误报告
  9. docker 搭建自己的github
  10. Vue中如何使用less