在CentOS 7 上安装docker

Docker CE
  1. Install yum-utils, which provides the yum-config-manager utility:

    $ sudo yum install -y yum-utils
    
  2. Use the following command to set up the stable repository:
    $ sudo yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo
    
  3. Optional: Enable the edge repository. This repository is included in the docker.repo file above but is disabled by default. You can enable it alongside the stable repository.
    $ sudo yum-config-manager --enable docker-ce-edge
    

    You can disable the edge repository by running the yum-config-manager command with the --disable flag. To re-enable it, use the --enable flag. The following command disables the edge repository.

    $ sudo yum-config-manager --disable docker-ce-edge
    

    Learn about stable and edge builds.

INSTALL DOCKER

  1. Update the yum package index.

    $ sudo yum makecache fast
    

    If this is the first time you have refreshed the package index since adding the Docker repositories, you will be prompted to accept the GPG key, and the key’s fingerprint will be shown. Verify that the fingerprint is correct, and if so, accept the key.

    Docker Edition Fingerprint
    Docker CE 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
    Docker EE DD91 1E99 5A64 A202 E859 07D6 BC14 F10B 6D08 5F96
  2. Install the latest version of Docker, or go to the next step to install a specific version.
    Docker Edition Command
    Docker CE sudo yum install docker-ce
    Docker EE sudo yum install docker-ee

    Warning: If you have multiple Docker repositories enabled, installing or updating without specifying a version in the yum install or yum update command will always install the highest possible version, which may not be appropriate for your stability needs.

  3. On production systems, you should install a specific version of Docker instead of always using the latest. List the available versions. This example uses the sort -r command to sort the results by version number, highest to lowest, and is truncated.

    Note: This yum list command only shows binary packages. To show source packages as well, omit the .x86_64 from the package name.

    $ yum list docker-ce.x86_64  --showduplicates |sort -r
    
    docker-ce.x86_64  17.03.0.el7                               docker-ce-stable
    

    The contents of the list depend upon which repositories are enabled, and will be specific to your version of CentOS (indicated by the .el7 suffix on the version, in this example). Choose a specific version to install. The second column is the version string. The third column is the repository name, which indicates which repository the package is from and by extension its stability level. To install a specific version, append the version string to the package name and separate them by a hyphen (-):

    Docker Edition Command
    Docker CE sudo yum install docker-ce-<VERSION>
    Docker EE sudo yum install docker-ee-<VERSION>
  4. Start Docker.
    $ sudo systemctl start docker
    
  5. Verify that docker is installed correctly by running the hello-world image.
    $ sudo docker run hello-world
    

    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

时间: 2024-10-06 13:37:48

在CentOS 7 上安装docker的相关文章

【docker】linux系统centOS 7上安装docker

要求: 一个centOS 7系统  虚拟就上安装CentOS 7步骤 1.Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 命令: uname -r 展示效果: 原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9178918.html

在CentOS 7上安装docker,部署spring boot

一.查看linux版本:lsb_release -a (如没有这个命令,安装:yum install -y redhat-lsb) uname -r docker 在centos安装,需要centos 7以上版本. 二.docker 安装操作步骤 docker 官网 :  https://docs.docker.com/get-started 安装必要的工具:Install required packages. yum-utils provides the yum-config-manager 

在centos linux上安装docker

前置条件 64-bit 系统 kernel 3.10+ 1.检查内核版本,返回的值大于3.10即可. $ uname -r 2.确保yum是最新的 $ yum update 3.安装 Docker yum install -y docker 4.启动docker systemctl start docker.service 5.验证安装是否成功(有client和service两部分表示docker安装启动都成功了) $docker version

Centos 7下安装Docker并采用加速器进行镜像下载加速

系统版本:[[email protected] _data]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) 在Centos 7上安装Docker$sudo yum u pdate$sudo yum -y install docker$sudo systemctl start docker 或者使用官方的安装脚本进行安装$sudo yum udpate$sudo curl -sSL https://get.docker.

CentOS 6.5上安装docker与docker对中文字符集的支持

一.CentOS 6.5上安装docker 在CentOS 6.5 还不能够直接通过yum install -y docker 来安装docker服务 在一些文档中有看到说是因为内核太低的原因导致的,因为docker至少要做3.8以上的版本才能安装, 但是我发现其实并不需要升级内核就可以实现docker的安装不过,也有可能我的安装存在偶然性, 但是我还是记录一下,以防日后忘记. 1.先查看下你的系统内核是多少 # uname -r 2.6.32-431.el6.x86_64 我的是CentOS

简单介绍一下在CentOS上安装Docker。

简单介绍一下在CentOS上安装Docker. 前置条件: 64-bit 系统 kernel 3.10+ 1.检查内核版本,返回的值大于3.10即可. $ uname -r 2.使用 sudo 或 root 权限的用户登入终端. 3.确保yum是最新的 $ yum update 4.添加 yum 仓库 运行 $ tee /etc/yum.repos.d/docker.repo <<-'EOF'[dockerrepo]name=Docker Repositorybaseurl=https://y

阿里云cenos 6.5 模板上安装 docker

本章将介绍在阿里云的 Centos6.5 模板上安装 Docker 以及在 Ubuntu 14.04 模板上安装 Docker 的过程 Centos 6.5 模板上使用Docker 首先,通过 ssh 登陆阿里云的服务器,查看系统版本号以及内核版本. Welcome to aliyun Elastic Compute Service! # lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core

CentOS 7.x 安装 Docker

安装之前确保之前没有安装过docker为此首先删除存在的docker程序 sudo yum remove docker docker-common docker-selinux docker-engine 这里我们需要安装的是社区版本  Docker CE ,而非Docker EE(企业版) 企业版是收费版本 首次在新的主机上安装 Docker CE 之前,您需要设置 Docker 镜像仓库.然后,您可以从此镜像仓库安装和更新 Docker. 设置镜像仓库 安装所需的软件包.yum-utils 

在CentOS7上安装docker篇

一.在CentOS7上安装docker篇 1. 查看系统版本: $ cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core) 2. 安装docker $ yum install docker 安装过程中报错: Transaction check error: file /usr/lib/systemd/system/blk-availability.service from install of device-mapper-7:1.