CentOS 7.9 安装 Docker

这篇具有很好参考价值的文章主要介绍了CentOS 7.9 安装 Docker。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

CentOS 7.9 安装 Docker

一、相关博客

【Docker】002-Docker安装

https://blog.csdn.net/qq_29689343/article/details/115261766

这篇笔记不是 Markdown 写的,改起来不方便,重新开一片记录!

二、安装 Docker

1、安装 device-mapper-persistent-data 和 lvm2 两个依赖

device-mapper-persistent-dataLinux 下的一个存储驱动, Linux 上的高级存储技术。 Lvm 的作用则是创建逻辑磁盘分区。

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

# 更新yum软件包索引
yum makecache fast

2、添加阿里云 Docker 镜像源

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3、安装 Docker 社区版

yum install docker-ce -y

4、启动

systemctl start docker
systemctl enable docker

# 查看版本
docker -v
# Docker version 24.0.2, build cb74dfc

5、运行测试

先配置阿里云镜像加速器

docker run hello-world
 
# 显示“……Hello from Docker!……”代表运行成功!
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
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:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. 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://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

三、配置阿里云镜像加速器

https://cr.console.aliyun.com/cn-hangzhou/instances

Docker 安装完毕后,之后我们去拉取 docker 镜像时,一般默认会去 docker 官方源拉取镜像。但是国内出海网速实在是太慢,所以选择我们更换为 阿里云镜像仓库 源进行镜像下载加速。

登录阿里云官网,打开 阿里云容器镜像服务。点击左侧菜单最下面的 镜像加速器 ,选择 CentOS (如下图)。按照官网的提示执行命令,即可更换 docker 镜像源地址。

CentOS 7.9 安装 Docker文章来源地址https://www.toymoban.com/news/detail-497918.html

# CentOS
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://wgsbq2gq.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

到了这里,关于CentOS 7.9 安装 Docker的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • docker基于centos7镜像安装python3.7.9

    下载centos7镜像 docker pull centos:centos7 启动容器centos-python-3.7 docker run -itd --name centos-python-3.7 -p 60021:22 --privileged centos:centos7 /usr/sbin/init 进入容器 docker exec -it centos-python-3.7 /bin/bash centos7环境下安装python3.7.9 在Linux的home目录下创建一个python3目录 mkdir /home/python3 切换到python3目录 c

    2024年02月15日
    浏览(34)
  • 【Linux | Docker基础篇】CentOS 7 安装 Docker并部署halo博客CMS详细图文教程

    目录 一、docker等名词简介 Docker 的核心概念 Docker 的优势 使用场景 二、docker安装步骤 1).卸载旧版本 2).安装依赖包 3).安装软件包 4).设置 stable 镜像仓库 5).更新 yum 软件包索引 6).安装 Docker 引擎 7).启动 Docker 8).测试是否安装成功 9).卸载docker 三、配置镜像加速 四、

    2024年02月21日
    浏览(36)
  • CentOS 7.9 安装图解

    风险告知 本人及本篇博文不为任何人及任何行为的任何风险承担责任,图解仅供参考,请悉知! 本次安装图解是在一个全新的演示环境下进行的,演示环境中没有任何有价值的数据,但这并不代表摆在你面前的环境也是如此。 生产环境全新安装或者自行测试都可参放心考该

    2024年01月19日
    浏览(32)
  • CentOS 7.9安装和更新

           写在前面:本文将从镜像下载、安装、首次更新系统。 CentOS7.9镜像文件下载地址:https://wiki.centos.org/Download 点击mirros链接,进入镜像列表,如下图: 点击其中一个,进入下载最新镜像文件下载页面,找到最新ISO文件:CentOS-7-x86_64-DVD-2207-02.iso,即22年7月更新的CentOS

    2024年02月11日
    浏览(28)
  • CentOS 7.9 安装 Jenkins

    Jenkins 是一个基于 Java 语言开发的持续构建工具平台,主要用于持续、自动的构建/测试你的软件和项目。它可以执行你预先设定好的设置和构建脚本,也可以和 Git 代码库做集成,实现自动触发和定时触发构建。 因为 Jenkins 是 Java 编写的持续构建平台,所以安装 Java 必不可少

    2024年02月17日
    浏览(33)
  • vmware虚拟机安装CentOS 7.9

    因为 CentOS8 不更新了,所以安装 7 ;简单就一笔带过了     选择下载好的操作系统的 iso 文件,下载地址 https://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/?spm=a2c6h.25603864.0.0.1f90f5adDfcZIZ 和方法为 centos-7.9.2009-isos-x86_64安装包下载_开源镜像站-阿里云 (aliyun.com)                     找到

    2024年04月12日
    浏览(32)
  • CentOS 7.9 安装 MySQL Redis

    安装包网上有 使用远程连接工具连接 CentOS 服务器,将 MySQL 压缩包上传到服务器上。 根目录创建 app 文件夹,把JDK压缩包通过xftp传到目标服务器 cd /app #进入根目录 tar -xvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz mv mysql-5.7.24-linux-glibc2.12-x86_64 /usr/local/mysql groupadd mysql # 添加 mysql 用户组

    2024年02月16日
    浏览(39)
  • CentOS 7.9 安装 mydumper(RPM方式)

     链接:https://pan.baidu.com/s/1sGhtiKPOmJw1xj0zv-djkA?pwd=taoz   码:taoz 开始正文啦: rpm -ivh mydumper-0.14.5-3-zstd.el7.x86_64.rpm 问题如下: 解决:  yum -y install epel-release  yum install -y libzstd 重新安装就成功了  rpm -ivh mydumper-0.14.5-3-zstd.el7.x86_64.rpm  验证:mydumper --help    

    2024年02月16日
    浏览(43)
  • 【CentOS 7.9】安装搜狗输入法教程

    1.如何在 centos7.x 中使用 搜狗输入法 1.切换至 root 用户 2.更新 yum 3.卸载 ibus 4.安装 epel 源 5.安装 fcitx 环境、qtwebkit包 和 alien 转换工具等(可以将 .deb 文件转为 .rpm 文件) 6.下载 2.2.0版本 的 linux 搜狗输入法 cd 至 downloads 目录,或者其他的目录,将这个 .deb 文件下载至此目录

    2024年01月22日
    浏览(35)
  • CentOS 7.9下JDK 1.8安装

    操作系统内核版本 操作系统发行版本 安装文件下载 查看运行进程 卸载软件文件 参数选项: 修改环境变量 生效环境变量 查看软件版本

    2024年01月16日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包