宝塔国际aaPanel自带安装Docker,安装了几次都失败,最后仔细看了安装日志,才发现其中的问题。
复制
--2023-11-28 13:42:13-- https://node.aapanel.com/install/0/docker_install_en.sh
Resolving node.aapanel.com (node.aapanel.com)... 104.21.79.196, 172.67.171.7, 2606:4700:3031::6815:4fc4, ...
Connecting to node.aapanel.com (node.aapanel.com)|104.21.79.196|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16976 (17K) [application/octet-stream]
Saving to: ‘docker_install_en.sh’0K .......... ...... 100% 34.6M=0s2023-11-28 13:42:13 (34.6 MB/s) - ‘docker_install_en.sh’ saved [16976/16976]selecting download node...
https://dg2.bt.cn
{"product": "Linux panel", "setup_path": "/www/server", "openlitespeed_path": "/usr/local", "language": "English", "title": "aaPanel Linux panel", "brand": "aaPanel", "root_path": "/www", "template": "default", "logs_path": "/www/wwwlogs", "home": "https://www.aapanel.com", "recycle_bin": true}
https://node.aapanel.comcat: /etc/redhat-release: No such file or directory
cat: /etc/redhat-release: No such file or directory
Get:1 http://security.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Hit:2 http://deb.debian.org/debian bookworm InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:4 http://security.debian.org/debian-security bookworm-security/main Sources [61.5 kB]
Get:5 http://security.debian.org/debian-security bookworm-security/main amd64 Packages [105 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main Translation-en [63.5 kB]
Ign:7 https://mirrors.aliyun.com/docker-ce/linux/debian 12 InRelease
Err:8 https://mirrors.aliyun.com/docker-ce/linux/debian 12 Release
404 Not Found [IP: 47.246.23.147 443]
Reading package lists...
E: The repository 'https://mirrors.aliyun.com/docker-ce/linux/debian 12 Release' does not have a Release file.
Reading package lists...
Building dependency tree...
Reading state information...
apt-transport-https is already the newest version (2.6.1).
ca-certificates is already the newest version (20230311).
curl is already the newest version (7.88.1-10+deb12u4).
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://security.debian.org/debian-security bookworm-security InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Ign:4 https://mirrors.aliyun.com/docker-ce/linux/debian 12 InRelease
Err:5 https://mirrors.aliyun.com/docker-ce/linux/debian 12 Release
404 Not Found [IP: 8.48.85.2 443]
Reading package lists...
E: The repository 'https://mirrors.aliyun.com/docker-ce/linux/debian 12 Release' does not have a Release file.
Reading package lists...
Building dependency tree...
Reading state information...
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Package 'docker-ce' has no installation candidate
curl: (23) Failure writing output to destination
chmod: cannot access '/usr/libexec/docker/cli-plugins/docker-compose': No such file or directory
Requirement already satisfied: pytz in ./pyenv/lib/python3.7/site-packages (2023.3)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: /www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip
Requirement already satisfied: docker in ./pyenv/lib/python3.7/site-packages (6.0.1)
Requirement already satisfied: packaging>=14.0 in ./pyenv/lib/python3.7/site-packages (from docker) (23.1)
Requirement already satisfied: requests>=2.26.0 in ./pyenv/lib/python3.7/site-packages (from docker) (2.28.2)
Requirement already satisfied: urllib3>=1.26.0 in ./pyenv/lib/python3.7/site-packages (from docker) (1.26.15)
Requirement already satisfied: websocket-client>=0.32.0 in ./pyenv/lib/python3.7/site-packages (from docker) (1.5.1)
Requirement already satisfied: charset-normalizer<4,>=2 in ./pyenv/lib/python3.7/site-packages (from requests>=2.26.0->docker) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in ./pyenv/lib/python3.7/site-packages (from requests>=2.26.0->docker) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in ./pyenv/lib/python3.7/site-packages (from requests>=2.26.0->docker) (2022.12.7)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: /www/server/panel/pyenv/bin/python3.7 -m pip install --upgrade pip
|-Successify --- Command executed! ---
阿里云镜像源的存储库中没有 Release 文件。
复制
E: The repository 'https://mirrors.aliyun.com/docker-ce/linux/debian 12 Release' does not have a Release file.
那就使用官方源安装 Docker。
如果是新的系统,需要安装一些必要的软件包,而我安装了宝塔国际,且之前已经安装过,则跳过这一步。
复制
apt update
apt upgrade -y
apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates
加入 Docker 的 GPG 公钥和 apt 源。
复制
# 添加 GPG 公钥
curl -sSL https://download.docker.com/linux/debian/gpg | gpg --dearmor > /usr/share/keyrings/docker-ce.gpg
# 添加 apt docker 源
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-ce.gpg] https://download.docker.com/linux/debian $(lsb_release -sc) stable" > /etc/apt/sources.list.d/docker.list
然后更新源再安装 Docker。
复制
# 更新软件包
apt update
# 安装 Docker
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
安装成功后,刷新 aaPanel 面板就可以正常运行 Docker,不再提示没有安装 Docker了。