CentOS7.6 Docker安装使用

安装Docker

更新本地yum仓库

安装epel扩展更新源

bash 复制代码
sudo yum install -y vim wget epel-release

更新yum仓库

bash 复制代码
sudo yum update -y

删除旧版本docker

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

安装yum管理工具并配置docker镜像源

安装yum管理工具

bash 复制代码
sudo yum install -y yum-utils

配置docker阿里镜像源

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

安装docker

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

启动docker并检验安装

bash 复制代码
sudo systemctl start docker && docker run hello-world

docker一键安装脚本

bash 复制代码
sudo yum install -y vim wget epel-release && yum update -y \
yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine	&& \

yum install -y yum-utils && yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \
yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin \
systemctl start docker && docker run hello-world
相关推荐
梅尔文.古11 分钟前
RaspberryPi-如何启用看门狗
linux·运维·服务器
木子欢儿12 分钟前
Ubuntu 24 安装 fcitx5 + rime + 雾凇配置
linux·运维·服务器·ubuntu
sg_knight14 分钟前
Nuxt 4 生产环境部署指南 (Node.js + Nginx)
运维·nginx·node.js·nuxt·ssr
企微自动化29 分钟前
自动化报表生成:将 RPA 采集的群聊数据自动整理为可视化周报
运维·自动化·rpa
代码游侠32 分钟前
学习笔记——IPC(进程间通信)
linux·运维·网络·笔记·学习·算法
txzz888833 分钟前
CentOS-Stream-10 YUM配置文件
linux·运维·centos·yum配置文件
星融元asterfusion37 分钟前
办公网+自建云:基于TIP OpenWiFi 控制器的混合组网一站式融合管理方案
运维·混合组网·openwifi
Henry Zhu12340 分钟前
VPP中ACL源码详解第二篇:ACL数据平面处理
运维·服务器·网络·计算机网络
qq_339191141 小时前
ubuntu 配置ulimit -n , ubuntu配置文件描述符数量, ubuntu优化,ubuntu系统调优
linux·运维·ubuntu