当前位置: 首页 > news >正文

docker安装

docker安装

Ubuntu安装docker:

 配置Ubuntu源:

cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
sed -i "s@http://.*archive.ubuntu.com@https://mirrors.aliyun.com/@g" /etc/apt/sources.list
sed -i "s@http://.*security.ubuntu.com@https://mirrors.aliyun.com/@g" /etc/apt/sources.list# 更新
apt-get update && apt-get upgrade

 Ubuntu安装docker:

# 更新源及安装依赖
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common# 添加密钥和仓库
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"# 安装 Docker
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

 安装cri-dockerd:

root@master:~# wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.13/cri-dockerd_0.3.13.3-0.ubuntu-jammy_amd64.deb
root@master:~# dpkg -i /home/chasel/cri-dockerd_0.3.13.3-0.ubuntu-jammy_amd64.deb
root@master:~# systemctl start cri-docker
root@master:~# systemctl status cri-docker
root@master:~# systemctl enable cri-docker
root@master:~# sed -i 's,^ExecStart.*,& --network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.9,' /usr/lib/systemd/system/cri-docker.service
root@master:~# systemctl daemon-reload
root@master:~# systemctl restart cri-docker

安装docker compose:

wget https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose 
chmod +x /usr/local/bin/docker-compose 
docker-compose --version

centos安装docker:

# 阿里 yum 源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
yum makecache

 安装docker

cd /etc/yum.repos.d/ && wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce -y
systemctl start docker
systemctl status docker
systemctl enable docker

  安装cri-dockerd:

wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.1/cri-dockerd-0.3.1-3.el7.x86_64.rpm
yum install -y cri-dockerd-0.3.1-3.el7.x86_64.rpm
sed -i 's,^ExecStart.*,& --network-plugin=cni --pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.9,' /usr/lib/systemd/system/cri-docker.service
systemctl daemon-reload
systemctl start cri-docker
systemctl status cri-docker
systemctl enable cri-docker

  

http://www.vanclimg.com/news/896.html

相关文章:

  • 二进制简史:从理论到芯片
  • js基础第四天
  • 同时点亮LED、数码管以及点阵
  • 关于跨域的一点新理解
  • js基础第三天
  • 龙哥量化:股票期货- 精华资料目录
  • 2025省选组合数学笔记
  • FM2023利兹联崛起之路#1
  • 07.08 论文精读 人像线稿生成模型
  • 暑训#3补题
  • 【LeetCode 141】算法:环形链表
  • 春训#2题解
  • 国内AI编码工具哪家强CodeBuddy+通义灵码+Trae
  • js基础第二天
  • [PaperReading] Stable Video Diffusion: Scaling Latent Video Diffusion Models to Large Datasets
  • Wireshark入门指南:网络流量分析利器
  • 2025/7/28 总结
  • 7.27 周总结
  • 存贮电解液配方的二进制格式与解析它的010 Editor的模板
  • 读《大道至简——软件工程实践者的思想》有感
  • 垃圾话1
  • 春训#1题解
  • js第一天
  • java学习(大道至简读后感)
  • linux中常用的数值计算
  • 【问题】--Macbook相关问题
  • 软工作业day27
  • 2025.7.28 闲话:CF678E Another Sith Tournament 倒序状压 DP 的一点想法
  • 7.28随笔
  • 外培总结