docker02docker安装

author author     2022-09-01     139

关键词:



一、在CentOS上安装Docker

以下版本的CentOS 支持 Docker :

  • CentOS 7 (64-bit)       # CentOS 从 7 开始,和 RHEL 7 一样都只支持 64 位架构。

  • CentOS 6.5 (64-bit) or later

请注意,由于 Docker 的局限性,Docker 只能运行在64位的系统中。

内核支持

      Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,需要内核版本是 2.6.32-431 或者更高版本 ,因为这是允许它运行的指定内核补丁版本。

1、安装 - CentOS-7

Docker 软件包已经包含在默认的 CentOS-Extras 软件源里,安装命令如下:

    $ yum install docker

FirewallD

      CentOS-7 中firewall的底层是使用iptables进行数据过滤,建立在iptables之上,这可能会与 Docker 产生冲突。当 firewalld 启动或者重启的时候,将会从 iptables 中移除 DOCKER 的规则,从而影响了 Docker 的正常工作。

        当你使用的是 Systemd 的时候, firewalld 会在 Docker 之前启动,但是如果你在 Docker 启动之后再启动 或者重启 firewalld ,你就需要重启 Docker 进程了。


2、安装 Docker - CentOS-6.5

        在 CentOS-6.5 中,Docker 包含在 Extra Packages for Enterprise Linux (EPEL) 提供的镜像源中,该组织致力于为 RHEL 发行版创建和维护更多可用的软件包。

        要求内核版本为3.10.0以上,由于RHEL 6和CentOS 6的内核版本为2.6,因此必须要先升级内核;所以一般都直接使用CentOS7。


       在 CentOS-6 中,一个系统自带的可执行的应用程序与 docker 包名字发生冲突,所以我们重新命名 docker 的RPM包名字为 docker-io

[[email protected] ~]# yum list|grep docker
docker-io.x86_64                            1.7.1-2.el6                  @epel  
docker.x86_64                               1.5-5.el6                    epel   
docker-io-devel.x86_64                      1.7.1-2.el6                  epel   
docker-io-fish-completion.x86_64            1.7.1-2.el6                  epel   
docker-io-logrotate.x86_64                  1.7.1-2.el6                  epel   
docker-io-vim.x86_64                        1.7.1-2.el6                  epel   
docker-io-zsh-completion.x86_64             1.7.1-2.el6                  epel   
fedora-dockerfiles.x86_64                   0-0.12.gitf6cd84c.el6        epel   
golang-github-docker-libcontainer.x86_64    1.1.0-10.gitdb65c35.el6      epel   
golang-github-docker-libcontainer-devel.x86_64
golang-github-docker-libtrust-devel.noarch  0-0.4.git6b78349.el6         epel   
golang-github-docker-libtrust-unit-test.x86_64
golang-github-docker-spdystream-devel.noarch
golang-github-docker-spdystream-unit-test.x86_64
golang-github-fsouza-go-dockerclient-devel.noarch
golang-github-fsouza-go-dockerclient-unit-test.x86_64
python-docker-py.x86_64                     0.7.0-1.el6                  epel   
python-docker-registry-core.noarch          2.0.1-2.el6                  epel   
python-dockerfile-parse.noarch              0.0.5-1.el6                  epel


CentOS-6 中 安装 docker-io 之前需要先卸载 docker 包:

    $ yum -y remove docker

下一步,安装 docker-io 包来为我们的主机安装 Docker:

    $  yum install docker-io

3、手动安装最新版本的 Docker

上述的 Docker 包可能不是最新发行版本。 如果你想安装最新版本

可以以不同的方式,安装多克尔根据您的需要:

  • 使用docker 官方的yum源(常用)


  • 下载源码包编译安装

Get Docker CE on CentOS

You can install Docker CE on CentOS in just three steps.

Enterprise customers can also installDocker EE for CentOS.

Prerequisites  先解决条件

Docker CE is supported on CentOS 7.3 64-bit.

1. Set up the repository

Set up the Docker CE repository on CentOS:

sudo yum install -y yum-utils

sudo yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo

sudo yum makecache fast

2. Get Docker CE

Install the latest version of Docker CE on CentOS:

sudo yum -y install docker-ce

Start Docker:

sudo systemctl start docker

3. Test your Docker CE installation

Test your installation:

sudo docker run hello-world

Next steps

These installation instructions work for standard installations of Docker CE. For more details or alternative installation procedures, including how to installedge builds, seeGet Docker for CentOS.


Dockerfiles

       CentOS 项目为开发者提供了大量的的示例镜像,作为开发模板或者学习 Docker 的实例。你可以在这里找到这些示例:

https://github.com/CentOS/CentOS-Dockerfiles



docker02

一、基于centos:latest创建新的镜像,新镜像已经配置好了yum并且安装了net-tools1、基于centos起动容器[[email protected]docker_images]#dockerrun-itcentosbash2、在容器中配置yum,并安装net-tools[[email protected]/]#rm-f/etc/yum.repos.d/*[[em 查看详情

docker的常用命令-02

#查看docker的版本信息$dockerversion#查看安装docker的信息$dockerinfo#查看本机Docker中存在哪些镜像$dockerimages#检索image$dockersearchubuntu:14.04#在docker中获取ubuntu镜像$dockerpullubuntu:14.04#显示一个镜像的历史$dockerhistorybirdben/ubuntu:v1 查看详情

elasticsearch_02_使用docker安装elasticsearch6.8.0(代码片段)

系列文章目录文章目录系列文章目录前言一、安装docker1、vmware上linux最小化安装2、linux上安装docker二、在docker上安装elasticsearch并通过windows访问1、拉取镜像2、修改linux系统配置参数3、启动es容器4、linux上访问ElasticSearch5、在windows... 查看详情

elasticsearch_02_使用docker安装elasticsearch6.8.0(代码片段)

系列文章目录文章目录系列文章目录前言一、安装docker1、vmware上linux最小化安装2、linux上安装docker二、在docker上安装elasticsearch并通过windows访问1、拉取镜像2、修改linux系统配置参数3、启动es容器4、linux上访问ElasticSearch5、在windows... 查看详情

day02docker学习-2,podman

​1.almaLinux系统安装见:​​https://blog.51cto.com/u_15506674/5857852​​2.almaLinux使用podman容器安装centos7.9过程解析类似​​docker安装centos7.9​​略过2.1下载镜像,启动容器,登入容器[root@192~]#podmanpullcentos:centos7.9.2009Resolved"centos" 查看详情

centos7安装docker

1.docker安装要求内核版本高于3.10,使用uname-r查看内核版本[[email protected]~]#uname-r4.20.02.安装docker [[email protected]~]#yum-yinstalldocker3.启动docker服务[[email protected]~]#servicedockerstartRedirectingto/bin/systemctlstartdocker.service 查看详情

docker的安装

Docker安装比较简单,没有太多前提条件,直接YUM就可以安装,当然你也可以选择编译安装,但是这就降低了安装包的可维护性。我们这里主要说YUM安装方式。Docker只能安装在RHEL6(CentOS6)以上版本且只能是64位操作系统。检查内... 查看详情

docker网络(代码片段)

文章目录一、Docker网络简介(1)查看Docker网络二、Docker的bridge网络(1)创建使用bridge网络的容器(2)修改容器的默认网段三、none网络四、host网络五、自定义网络(1)自定义bridge网络(2)... 查看详情

cenos6离线安装docker

1.注意事项1.docker需要依赖libcgroup库2.docker需要依赖device-mapper系列并且该系列包版本号大于1.02.793.本次安装的是1.7.1版本dockercentos采用的6.5理论上来说Centos7系列更好安装, 2.安装依赖1.安装libcgroup库(此操作很危险,能不需要安装,尽... 查看详情

Docker 命令无法连接到 Docker 守护进程

】Docker命令无法连接到Docker守护进程【英文标题】:Dockercommandcan\'tconnecttoDockerdaemon【发布时间】:2016-02-0707:46:04【问题描述】:我想转向Docker,所以我刚刚开始搞乱它。我在VirtualBoxUbuntu15.10(WilyWerewolf)安装上安装了Docker,并以sug... 查看详情

Mac 上的 Docker 机器:在 docker 主机/docker 机器上看不到已安装的卷?卷物理存储在哪里?

】Mac上的Docker机器:在docker主机/docker机器上看不到已安装的卷?卷物理存储在哪里?【英文标题】:DockerMachineonMac:CannotseemountedVolumesondockerhost/docker-machine?Wherearevolumesphysicallystored?【发布时间】:2016-02-0802:31:38【问题描述】:我... 查看详情

docker安装kibana(代码片段)

官网镜像地址:https://hub.docker.com/_/kibana使用和 elasticsearch相同版本镜像6.4.0(不一样可能会出现问题)1、下载镜像dockerpullkibana:6.4.02、运行容器dockerrun-d--namekibana--netsomenetwork-p5601:5601kibana:6.4.03、打开浏览器  http://127.0.0... 查看详情

如何使用 docker compose 安装 ElasticSearch 插件

】如何使用dockercompose安装ElasticSearch插件【英文标题】:HowtoinstallElasticSeachpluginsusingdockercompose【发布时间】:2017-02-0303:17:13【问题描述】:我有一个带有弹性搜索图像的docker-compose.yml文件:elasticsearch:image:elasticsearchports:-"9200:9200"... 查看详情

docker002安装docker-ce(代码片段)

docker002安装docker-ceDockerEngine-Community简称docker-ce。 Ubuntu中安装docker-ce系统要求系统为64位版本(16.04及以上版本)卸载旧版本$sudoapt-getremovedockerdocker-enginedocker.iocontainerdrunc###支持的驱动overlay2aufsBtrfsdocker-ce默认使用overlay2作为存... 查看详情

Docker 运行不显示任何输出

】Docker运行不显示任何输出【英文标题】:Dockerrundoesnotdisplayanyoutput【发布时间】:2019-02-1310:27:16【问题描述】:我在树莓派上安装了docker(通过ssh连接)安装成功。但运行dockerrunhello-world不会产生任何输出。注意我第一次收到... 查看详情

docker02:docker核心技术探索使用cgroup限制资源的使用(代码片段)

可以限定容器中的虚拟系统对于各种资源的使用,包括cpu,内存,磁盘和网络资源,这需要使用cgroup相关技术来实现。为了使用cgroup相关的功能,我们首先需要将cgroup提供的特殊文件系统cgroup安装到我们的容器中。在容器的/etc/fst... 查看详情

docker发布微服务lnmp综合应用(代码片段)

目录环境一、搭建harbo镜像仓库二、docker02操作1.docker自定义网络2.容器运行服务3.登录网页安装WordPress三、docker03操作1.下载镜像2.容器运行服务3.登录网页安装WordPress总结环境角色主机名IP安装服务镜像服务器docker01172.16.0.128harbo应... 查看详情

如何在 Ubuntu 18 上安装较旧的 Docker 版本(18.06.2)?

】如何在Ubuntu18上安装较旧的Docker版本(18.06.2)?【英文标题】:HowtoinstallolderDockerversion(18.06.2)onUbuntu18?【发布时间】:2020-02-2905:28:49【问题描述】:我已经尝试安装Kubernetes好几天了,但它已经从Docker开始了。我似乎在Ubuntu上找... 查看详情