Docker安装
1、安装条件
CentOS 7 (64-bit) ,内核3.10及以上; CentOS 6,5 (64-bit),内核2.6.32-431及以上。2、CentOS6.8安装
```shell ##安装Docker依赖库 yum install -y epel-release ##执行Docker yum install -y docker-io ##安装后配置文件: /etc/sysconfig/docker ##启动Docker并确认版本 service docker start docker version ##运行hello-world镜像 docker run hello-world<h1>3、CentOS7.0安装</h1>
官网步骤:https://docs.docker.com/install/linux/docker-ce/centos/
<h1>4、使用Yum方式安装(CentOS7.0)</h1>
```shell
##执行系统更新
yum update
##配置Yum源
cat >/etc/yum.repos.d/docker.repo <<EOF
[dockerrepo]
name=Docker Repository
baseurl=http://yum.dockerproject.org/repo/main/centos/7
enable=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
##安装Docker
yum install docker
5、使用Script方式安装(CentOS7.0)
```shell ##执行系统更新 yum update ##执行安装脚本 curl -sSL https://get.docker.com/ | sh ##启动Docker systemctl start docker ##设置开机自启 systemctl enable docker ##运行hello-world镜像 docker run hello-world ```6、使用Rpm包安装(CentOS7.0)
下载目录:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
7、Docker镜像下载加速配置
登录网址:https://dev.aliyun.com/search.html
注册后得到加速ID,假设为:kfp63jaj
执行如下命令:
##copy配置文件(CentOS7.0配置文件:/etc/docker/deamon.json)
cp /lib/systemd/system/docker.server /etc/systemd/system/docker.server
##更改权限
chmod a+x /etc/systemd/system/docker.server
##修改文件
vi /etc/systemd/system/docker.server
##在ExecStart=/usr/bin/dockerd-current后添加如下内容
ExecStart=/usr/bin/dockerd-current --registry-mirror=https://kfp63jaj.mirror/aliyun.com
##重新加载配置文件并重启
systemctl daemon-reload
systemctl restart docker
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!