Cenots安装Docker
来源:互联网 发布:复杂网络的研究方向 编辑:程序博客网 时间:2024/05/20 09:08
一、添加Docker仓库
1.安装
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-utils:管理repository及扩展包的工具提供了yum-config-manager
yum-config-manager:管理仓库用
yum-config-manager的选项使用: yum-config-manager –add-repo“仓库路径” 添加仓库 yum-config-manager –disable “仓库名" 禁用仓库 yum-config-manager –enable “仓库名” 启用仓库
device-mapper-persistent-data、lvm2:devicemapper存储驱动程序所必需的
devicemapper:Docker Engine基于Device Mapper提供的一种存储驱动
DeviceMapper:Linux系统中的高级卷管理技术框架
2.添加Docker仓库
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
命令完成后你会发现 /etc/yum.repo/ 下多了个docker-ce.repo
二、安装Docker CE
1.这条命令会安装最新版的Docker
yum install docker-ce
2.安装特定版Docker
查看Docker CE的版本,从高到底排序
yum list docker-ce --showduplicates | sort -r
[root@localhost yum.repos.d]# yum list docker-ce --showduplicates | sort -r * updates: mirrors.163.comLoading mirror speeds from cached hostfileLoaded plugins: fastestmirrorInstalled Packages * extras: mirrors.zju.edu.cndocker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.09.1.ce-1.el7.centos @docker-ce-stabledocker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
安装特定版本对比上面的也就是两个前半截凑起来就是包名,比如:
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
安装就是:
yum install docker-ce-17.09.1.ce
1.启动Docker
systemctl start docker
2.获取一个Docker image
docker search whalesay #这条命令会获取一个鲸鱼的小镜像
[root@localhost yum.repos.d]# docker search whalesayNAME DESCRIPTION STARS OFFICIAL AUTOMATEDdocker/whalesay An image for use in the Docker demo tutorial 621 mendlik/docker-whalesay Docker whalesay image from training materi... 6 [OK]sabs1117/whalesay Whalesay with fortune phrases. 1 nikovirtala/whalesay Tiny Go web service to print Moby Dock ASC... 1 [OK]milanfort/whalesay Modified docker/whalesay image that output... 1 swinton/whalesay whalesay, innit 1 ojenge/whalesay from docker/whalesay 1 caibar/whalesay Builds automatizados. 1 [OK]jracionero/docker-whalesay My smarter docker whalesay 0 puneethp/whalesay Docker-Whalesay 0 firecyberice/whalesay Docker **Cloud** automated build for **amd... 0 forsingh/whalesay whalesay 0 [OK]claytonrogers/docker-whalesay Whalesay automated build 0 [OK]asakilan/pg-whalesay My whalesay 0 dhalljohnston/whalesay whalesay 0 whalebrew/whalesay 0 blaines/whalesay 0 tiagoferreira/whalesay Whalesay image 0 phyominhtun/whalesay My whalesay image! 0 liuzhishan/docker-whalesay docker-whalesay 0 laveshin/whalesay whalesay image 0 hongxi/whalesay-fortunes Demo, the whalesay-fortunes 0 jetolabs/whalesay whalesay with fortune cookie messages 0 nateliu/whalesay first test of whalesay 0 bjarkebard/whalesay testing whalesay 0
3.将image pull下来到本地
docker pull docker/whalesay
[root@localhost yum.repos.d]# docker pull docker/whalesayUsing default tag: latestlatest: Pulling from docker/whalesaye190868d63f8: Pull complete 909cd34c6fd7: Pull complete 0b9bfabab7c1: Pull complete a3ed95caeb02: Pull complete 00bf65475aba: Pull complete c57b6bcc83e3: Pull complete 8978f6879e2f: Pull complete 8eed3712d2cf: Pull complete Digest: sha256:178598e51a26abbc958b8a2e48825c90bc22e641de3d31e18aaf55f3258ba93bStatus: Downloaded newer image for docker/whalesay:latest
4.查看刚刚pull下来的镜像
docker images
[root@localhost yum.repos.d]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEdocker/whalesay latest 6b362a9f73eb 2 years ago 247MB
5.启动容器打出hello world
docker run docker/whalesay cowsay hello world
[root@localhost yum.repos.d]# docker run docker/whalesay cowsay hello world _____________ < hello world > ------------- \ \ \ ## . ## ## ## == ## ## ## ## === /""""""""""""""""___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\______/
阅读全文
0 0
- Cenots安装Docker
- cenots Debian 安装openoffice
- cenots配置
- cenots PS1变量详解
- cenots 基本备份方法
- cenots下网桥创建
- cenots下网卡配置
- docker--docker安装
- docker-centos安装docker
- Docker-4.安装Docker
- [docker]安装docker
- Docker----CentOS Docker 安装
- docker安装
- docker-安装
- docker安装
- 安装Docker
- docker 安装
- docker安装
- spring的重试机制无效@Retryable@EnableRetry
- java 利用反射机制,获取实体所有属性和方法,并对属性赋值
- Find Extra One_Codeforces_900A
- HIVE的transform函数的使用
- 日期字符串拆分算法
- Cenots安装Docker
- 面向对象--(一)
- 用Python从零开始构造决策树
- C#-五层架构开发(一)
- 常用编程语言概述
- 1017. A除以B (20)
- 从现象到原理揭露seo快速排名的面纱
- Jmeter简单介绍与搭配Jenkins实现自动化测试实践
- 1018. 锤子剪刀布 (20)