Linux MiniMal版本常规所需环境安装

Docker 环境安装

前置工作 之 基础环境安装

当前环境

centos7.9 64位 minimal版本

当前环境为 root用户

若当前存在Docker环境 需卸载

yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

更新 yum 并下载curl工具

yum update -y && yum install curl -y

安装net-tool

yum -y install net-tools.x86_64

安装Wget

yum -y install wget

安装gcc相关环境

yum -y install gcc
yum -y install gcc-c++

安装yum工具包

yum install -y yum-utils

修改为阿里云yum源(不可以先更换源、应先执行上面的命令、否则会导致yum失效)

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bk
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
yum clean all
yum makecache
yum makecache fast

设置docker的仓库地址

阿里云
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
清华大学
yum-config-manager \
--add-repo \
https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo

Docker 安装

安装docker

yum install docker-ce docker-ce-cli containerd.io

启动docker

systemctl start docker

重启docker

systemctl restart docker

打印HelloWorld

docker run hello-world

出现以下内容即为成功

posted @   LiuShuku  阅读(300)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示