centos7docker(centos7docker安装部署)

本篇文章给大家谈谈centos7docker,以及centos7docker安装部署对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

CentOS7安装Docker

Docker支持以下的CentOS版本:

CentOS 7 (64-bit)

CentOS 6.5 (64-bit) 或更高的版本

前态手提条件

目前,CentOS 仅发行版本中的内核支持 Docker。

Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。

Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版者闭扰本。

Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。

1、使用 sudo 或 root 权限登录 Centos。

2、确保 yum 包更新到最新。

1.创建目录和配置文件redis.conf

如果是阿里云服务器还需要配置阿里云安全策略

到此,docker 在 CentOS 系统的安装及相关使用完成。

更多首旦spring boot/spring cloud学习资源:

更多区块链学习资源:

如何在Centos7上安装&使用docker

CentOS7中Docker的安装Docker软件包已经包括在默认的CentOS-Extras软件源里。因此想要安装docker,只需要运行下面的yum命令锋桥:[root@localhost~]#yuminstalldocker启动Docker服务安装完成后,使用下面的命令来启动docker服务,并将其设置知基敬为开机启动:[root@localhost~]#servicedockerstart[root@localhost~]#chkconfigdockeron(LCTT译注:此处采用了旧式的sysv语法,如采用CentOS7中支持的搭慎新式systemd语法,如下:[root@localhost~]#systemctlstartdocker.service[root@localhost~]#systemctlenabledocker.service)下载官方的CentOS镜像到本地[root@localhost~]#dockerpullcentosPullingrepositorycentos192178b11d36:Downloadcomplete70441cac1ed5:Downloadcompleteae0c2d0bdc10:Downloadcomplete511136ea3c5a:Downloadcomplete5b12ef8fd570:Downloadcomplete确认CentOS镜像已经被获取:[root@localhost~]#dockerimagescentosREPOSITORYTAGIMAGEIDCREATEDVIRTUALSIZEcentoscentos5192178b11d362weeksago466.9MBcentoscentos670441cac1ed52weeksago215.8MBcentoscentos7ae0c2d0bdc102weeksago224MBcentoslatestae0c2d0bdc102weeksago224MB运行一个Docker容器:[root@localhost~]#dockerrun-i-tcentos/bin/bash[root@dbf66395436d/]#我们可以看到,CentOS容器已经被启动,并且我们得到了bash提示符。在docker命令中我们使用了“-i捕获标准输入输出”和“-t分配一个终端或控制台”选项。若要断开与容器的连接,输入exit。[root@cd05639b3f5c/]#cat/etc/redhat-releaseCentOSLinuxrelease7.0.1406(Core)[root@cd05639b3f5c/]#exitexit[root@localhost~]#我们还可以搜索基于Fedora和Ubuntu操作系统的容器。[root@localhost~]#dockersearchubuntu[root@localhost~]#dockersearchfedora显示当前正在运行容器的列表

centos7 最小化安装后 怎么安装docker

方法如下桥弊: 1、Docker 软件包已经包括在默认的 CentOS-Extras 软件源里,需要配顷晌置好yum源, 2、安装docker命令如下: yum -y install docker, 3、安装完成后,使用下面的命令来启动 docker 服务 4、下载官方雀消锋的 CentOS 镜像到本地 ,docker pull ...

如何在 CentOS 7 上安装 Docker

Docker 软件包已经包括在默认的 CentOS-Extras 软件源里。因此想要安装 docker,只需要运行下面的 yum 命令:

[root@localhost ~]# yum install docker

查看docker版本

[root@localhost ~]# docker    version

Client:

Version:      1.8.3

API version:  1.20

Go version:   go1.4.2

Git commit:   cedd534-dirty

Built:        Fri Jan 22 06:07:01 UTC 2016

OS/Arch:      linux/amd64

Server:

Version:      1.8.3

API version:  1.20

Go version:   go1.4.2

Git commit:   cedd534-dirty

Built:        Fri Jan 22 06:07:01 UTC 2016

OS/Arch:      linux/amd64

显示版本为docker 1.83,API 版本 1.20 。

启动 Docker 服务

安装完成后,使用下面的命令来启动 docker 服务,并将其设置为开机启动:

[root@localhost ~]# systemctl  start docker.service

[root@localhost ~]# systemctl  enable docker.service

下载官方的 CentOS 镜像到本地

[root@localhost ~]# docker pull centos

Pulling repository centos

192178b11d36: Download complete

70441cac1ed5: Download complete

ae0c2d0bdc10: Download complete

511136ea3c5a: Download complete

5b12ef8fd570: Download complete

确认 CentOS 镜像已经被获取

[root@localhost ~]# docker images centos

REPOSITORY    TAG      侍森局    IMAGE ID      CREATED       VIRTUAL SIZE

centos        centos5      192178b11d36  2 weeks ago   466.9 MB

centos        centos6      70441cac1ed5  2 weeks ago   215.8 MB

centos  老让      centos7      ae0c2d0bdc10  2 weeks ago   224 MB

centos        latest       ae0c2d0bdc10  2 weeks ago   224 MB

运行一个 Docker 容器

[root@localhost ~]# docker run -i -t centos /bin/bash

[root@dbf66395436d /]#

我们可以看到 CentOS 容器已经春茄被启动,并且我们看到了 bash 提示符。在 docker 命令中我们使用了 “-i 捕获标准输入输出”和 “-t 分配一个终端或控制台”选项。

了解更多:

若要断开与容器的连接,则输入 exit。

[root@cd05639b3f5c /]# cat /etc/redhat-release

CentOS Linux release 7.0.1406 (Core)

[root@cd05639b3f5c /]# exit

exit

[root@localhost ~]#

我们还可以搜索基于 Fedora 和 Ubuntu 操作系统的容器

[root@localhost ~]# docker search ubuntu

[root@localhost ~]# docker search fedora

显示当前正在运行容器的列表

[root@localhost ~]# docker   ps

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                   NAMES

e422481ac1ce        daocloud.io/daocloud/dao-2048   "nginx -g 'daemon off"   45 hours ago        Up 45 hours         0.0.0.0:32768-80/tcp   hungry_visvesvaraya

[img]

centos7怎么安装docker

安装docker

1、Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。

通过 uname -r 命令查看你当前的内核版本

$ uname -r

2、使用 root 权限登录 Centos。确保 yum 包更新到最新。

$ sudo yum update

3、卸载旧版本(如果安装过旧版本的话)

$ sudo yum remove docker docker-common docker-selinux docker-engine

4、安装需要的软册并尺蔽纤件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

5、设置yum源

$ sudo yum-config-manager --add-repo

6、可以查看所有仓库中所有docker版本,并选择特定版本安装

$ yum list docker-ce --showduplicates | sort -r

7、安装docker

$ sudo yum install docker-ce #由于repo中默认只开启stable仓库,故这里安装的是最新稳定版17.12.0

$ sudo yum install FQPN州高 # 例如:sudo yum install docker-ce-17.12.0.ce

8、启动并加入开机启动 《Linux就该这么学》

$ sudo systemctl start docker

$ sudo systemctl enable docker

9、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)

$ docker version

关于centos7docker和centos7docker安装部署的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

标签列表