CentOS 安装Docker

Docker官网 Install Docker Engine on CentOS | Docker Docs

1.查看系统版本,Docker支持CentOS 7及以上版本

bash 复制代码
cat /etc/redhat-release

2.卸载旧版本

bash 复制代码
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

3.安装依赖

bash 复制代码
yum install -y gcc
yum install -y gcc c++
yum install -y yum-utils

4.设置阿里云镜像库

bash 复制代码
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

5.安装Docker CE

bash 复制代码
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

6.启动 Docker

bash 复制代码
systemctl start docker

7.验证安装

bash 复制代码
#查看版本
docker version    

docker run hello-world

bash 复制代码
docker run hello-world
相关推荐
hello_25014 分钟前
动手模拟docker网络-bridge模式
网络·docker·桥接模式
Codigger官方26 分钟前
Linux 基金会牵头成立 React 基金会:前端开源生态迎来里程碑式变革
linux·前端·react.js
武文斌7727 分钟前
项目学习总结:LVGL图形参数动态变化、开发板的GDB调试、sqlite3移植、MQTT协议、心跳包
linux·开发语言·网络·arm开发·数据库·嵌入式硬件·学习
爱吃喵的鲤鱼30 分钟前
仿mudou——Connection模块(连接管理)
linux·运维·服务器·开发语言·网络·c++
让子弹飞0239 分钟前
永久解决ubuntu网络连接问题
linux·运维·ubuntu
郝学胜-神的一滴1 小时前
使用Linux的read和write系统函数操作文件
linux·服务器·开发语言·数据库·c++·程序人生·软件工程
小醉你真好2 小时前
15、Docker Compose 安装ELK + Filebeat单机版
elk·docker·jenkins
七七七七072 小时前
【Linux 系统】打开文件和文件系统
linux·运维·spring
DeeplyMind3 小时前
第二章:模块的编译与运行-7 Loading and Unloading Modules
linux·驱动开发
---学无止境---3 小时前
Linux中驱动程序通过fasync异步通知应用程序的实现
linux