在这里我们使用的是docker的社区版Docker CE,针对的是未安装docker的新的主机,如果安装过docker的早期版本,先卸载它们及关联的依赖资源,安装的版本为docker 18.03。

  1、使用yum安装所需的软件包

[origalom@origalom ~]$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

  2、设置 stable 镜像仓库

[origalom@origalom ~]$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

  3、启用edge 和 testing 镜像仓库

[origalom@origalom ~]$ sudo yum-config-manager --enable docker-ce-edge
[origalom@origalom ~]$ sudo yum-config-manager --enable docker-ce-test
[origalom@origalom ~]$ sudo yum-config-manager --disable docker-ce-edge # 禁用

  4、安装最新的CE

[origalom@origalom ~]$ sudo yum install docker-ce

  5、安装指定版本的CE

    在生产环境中,应安装特定版本的CE,而不是每次都使用最新版本。

[origalom@origalom ~]$ yum list docker-ce --showduplicates | sort -r    # 查找可用版本
[origalom@origalom ~]$ sudo yum install docker-ce-<VERSION STRING> # 安装指定版本

  6、启动docker

[origalom@origalom ~]$ sudo systemctl start docker

  7、验证是否安装成功

[origalom@origalom ~]$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:97ce6fa4b6cdc0790cda65fe7290b74cfebd9fa0c9b8c38e979330d547d22ce1
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://cloud.docker.com/ For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/

  此命令将下载一个测试镜像并在容器中运行它。容器运行时,它将输出一条参考消息并退出。

参考文档:

  docker中文社区

  docker官网

docker运行环境安装-centos(一)的更多相关文章

  1. docker运行环境安装-后续步骤(二)

    1.以非 root 用户身份管理 Docker [origalom@origalom ~]$ sudo groupadd docker # 创建docker用户组[origalom@origalom ...

  2. Linux Centos7部署环境安装-CentOS

    Linux Centos7部署环境安装-CentOS Centos7部署环境安装及Linux常用命令 centos系统下各文件夹的作用 centos7修改系统默认语言 centos7安装rz/sz命令 ...

  3. Tsung运行环境安装(转)

    转自:http://www.cnblogs.com/tsbc/p/4272974.html#_Toc372013359 tsung Tsung运行环境安装 检查安装一下依赖包,以免在安装的时候报错.( ...

  4. 2步安装1个hive docker运行环境[centos7]

    1 构建基础容器 基于centos环境docker环境快速搭建,执行步骤 docker build -t cenosbase7 . 执行此步骤就可以构建1个基础的centos基础运行环境 相关的文件如 ...

  5. win10安装docker运行环境

    转自:https://www.cnblogs.com/stulzq/p/7743667.html Docker for Windows是Docker社区版(CE)应用程序. Docker for Wi ...

  6. Docker学习笔记之搭建Docker运行环境

    0x00 概述 既然 Docker 是一款实用软件,我们就不得不先从它的安装说起,只有让 Docker 运行在我们的计算机上,才能更方便我们对 Docker 相关知识和使用方式的学习.得益于与商业性的 ...

  7. 2.云原生之Docker容器环境安装实践

    转载自:https://www.bilibili.com/read/cv15181036/?from=readlist 官方一键安装脚本 补充时间:[2020年4月22日 11:00:59] 一键安装 ...

  8. ECOS运行环境安装(一)

    ECOS为上海商派公司研发的PHP电商框架.详情见 http://www.ec-os.net/doc.html 本文介绍CentOS6.x 64位下安装ECOS1.2运行环境的具体步骤: 1)需要准备 ...

  9. Docker03-安装Docker运行环境

    目录 Ubuntu 18 中安装Docker 查看Docker安装信息 查看Docker版本,命令:docker version 查看Docker运行信息,命令: docker info 检查安装是否 ...

随机推荐

  1. 将int型数值拆分成4字节

  2. [bzoj1009](HNOI2008)GT考试 (kmp+矩阵快速幂加速递推)

    Description 阿 申准备报名参加GT考试,准考证号为N位数X1X2....Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字.他的不吉利数学 A1A2...Am(0&l ...

  3. [转载]android工程中引入另一个工程中的资源

    原文地址:android工程中引入另一个工程中的资源作者:87fayuan 在项目中可能遇到这样的问题:项目过大,于是细分为N个子模块来做,每个模块都是不同的工程.涉及到activity传数据时,可以 ...

  4. [Android Pro] ListView,GridView之LayoutAnimation特殊动画的实现

    转载自:http://gundumw100.iteye.com/blog/1874545 LayoutAnimation干嘛用的?不知道的话网上搜一下. Android的Animation之Layou ...

  5. iOS:图片上传时两种图片压缩方式的比较

    上传图片不全面的想法:把图片保存到本地,然后把图片的路径上传到服务器,最后又由服务器把路径返回,这种方式不具有扩展性,如果用户换了手机,那么新手机的沙盒中就没有服务器返回的图片路径了,此时就无法获取之 ...

  6. unity reflection probe --- forward deferred transparent opaque

    deferred 和forward reflection probe 的差别 deferred ref是逐像素的 forward是逐 obj 但我还遇到一个问题就是box projection ref ...

  7. Oracle数据迁移至HBase操作记录

    Oracle数据迁移至HBase操作记录 @(HBase) 近期需要把Oracle数据库中的十几张表T级别的数据迁移至HBase中,过程中遇到了许多苦难和疑惑,在此记录一下希望能帮到一些有同样需求的兄 ...

  8. Android-各个屏幕的logo尺寸要求

    DENSITY SIZE LOCATION RATIO SCREEN MARGIN XXXHDPI 192×192 drawable-xxxhdpi 4 640 DPI 12 to 16 pixels ...

  9. 转: codereview 工具平台建设

    一.  Rietveld  code review  (一套工具系统与平台) 1. http://www.cnblogs.com/fang9159/archive/2012/07/20/2591690 ...

  10. [Functional Programming Monad] Combine Stateful Computations Using A State Monad

    The true power of the State ADT really shows when we start combining our discrete, stateful transact ...