找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 139|回复: 1

ubuntu22.04更改源,安装Docker 及docker compose

[复制链接]

1

主题

0

回帖

7

积分

新手上路

积分
7
发表于 2025-7-4 21:17:22 | 显示全部楼层 |阅读模式
ubuntu22.04更改源一 查看操作系统版本
  1. lsb_release -a
复制代码
二 备份镜像源
  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
复制代码
三 镜像源站点官网
  • 阿里云开源镜像站
  • ubuntu 22.04 LTS (jammy) 配置如下

  1. sudo rm -rf /etc/apt/sources.list && sudo nano /etc/apt/sources.list
复制代码

  1. deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse

  3. deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse

  5. deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse

  7. # deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
  8. # deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse

  9. deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
  10. deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
复制代码
  • 清华大学开源镜像站 ubuntu 22.04 LTS (jammy) 配置如下

  1. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
  2. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
  3. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
  4. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
  5. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
复制代码
重新load一下配置


  1. sudo systemctl daemon-reload
复制代码
docker及docker-compose安装
  1. mkdir -p /etc/docker &&
  2. touch /etc/docker/daemon.json&&
  3. cat > /etc/docker/daemon.json << EOF
  4. {
  5.   "registry-mirrors": [
  6.         "https://docker-0.unsee.tech",
  7.         "https://docker.1panel.live",
  8.         "https://registry.dockermirror.com",
  9.         "https://docker.imgdb.de",
  10.         "https://docker.m.daocloud.io",
  11.         "https://hub.firefly.store",
  12.         "https://hub.littlediary.cn",
  13.         "https://hub.rat.dev",
  14.         "https://dhub.kubesre.xyz",
  15.         "https://cjie.eu.org",
  16.         "https://docker.1panelproxy.com",
  17.         "https://docker.hlmirror.com",
  18.         "https://hub.fast360.xyz",
  19.         "https://dockerpull.cn",
  20.         "https://cr.laoyou.ip-ddns.com",
  21.         "https://docker.melikeme.cn",
  22.         "https://docker.kejilion.pro"
  23.   ]
  24. }
  25. EOF

  26. apt update &&
  27. apt install -y wget unzip tar jq docker.io docker-compose &&
  28. systemctl enable docker &&
  29. systemctl start docker &&
  30. systemctl restart docker
复制代码



3

主题

1

回帖

19

积分

新手上路

积分
19
发表于 2025-7-4 21:21:07 | 显示全部楼层
拉取镜像
  1. docker pull nginx
  2. docker pull php:fpm
  3. docker pull php:7.4.33-fpm
  4. docker pull mysql
  5. docker pull redis
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Home!

GMT+8, 2025-12-6 11:45 , Processed in 0.017967 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表