我的debian 11 server1没有互联网接入,它从另一个安装了apt-cacher-ng
的server2安装缓存的debian包。sources.list
文件在server1中通过server2中的nginx
反向代理指向apt-cacher-ng
。
根据docker.com,我必须添加echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-cacher-ng
将如何处理这个问题?是否可以通过apt-cacher-ng
来提取和构建码头图像/容器?
目前,在server2 /etc/apt-cacher-ng/acng.conf
中,行Remap-dockercom: http://docker.cache ; file:backends_docker_com
。backend_docker_com
文件包含以下内容:https://download.docker.com/linux/debian
,Server2的域名,缓存正在进行的域名是ace
在Server1上,在/etc/apt/apt.conf.d/00-proxy
中,有以下内容:
Acquire::http { Proxy "http://ace:3142"; }
Acquire::https { Proxy "https://ace:3142"; }
Acquire::http::Proxy::ace DIRECT
我仍然无法从server1构建图像
发布于 2022-09-22 20:39:39
apt-cacher-ng
被专门设计成APT包存储库的代理;它不能用于容器映像。
Docker可以使用通用代理。要设置它,请参阅码头守护进程文档;简单地说,创建一个名为/etc/systemd/system/docker.service.d/http-proxy.conf
的文件,其中包含
[Service]
Environment="HTTP_PROXY=http://yourproxy:port"
Environment="HTTPS_PROXY=https://yourproxy:port"
使用适当的值,然后重新加载配置(sudo systemctl daemon-reload && sudo systemctl restart docker
)。
https://unix.stackexchange.com/questions/718357
复制相似问题