在我的家庭网络上无需更改我的客户,是否有一种很好的方法来缓存APT和PIP软件包?

发布于 2025-01-24 18:31:51 字数 278 浏览 3 评论 0原文

我正在测试和构建许多容器,通过互联网连接缓慢。每次我测试重建时,都必须重新下载所有APT和PIP软件包。

我已经看到了一些与Docker本地缓存的解决方案,但是我需要构建过程来为其他开发人员以及部署期间工作。

我还找到了许多解决方案,可以使用本地服务器缓存APT和PIP,但是所有这些解决方案都需要更改客户也对我也不起作用的客户。

有什么方法可以将路由器级别的DNS重定向到本地软件包缓存服务器或类似的解决方案?

另外,希望避免XY问题,我是否缺少更好的解决方案?

谢谢!

I am testing and building a lot of containers over a somewhat slow internet connection. Every time I test a rebuild it has to re-download all the apt and pip packages.

I have seen a couple solutions to cache locally with docker, but I need the build process to work for other developers and also during deploy.

I have also found a number of solutions to caching apt and pip with a local server, but all of them require changes to the clients which also won't work for me.

Is there a way I can set up a router level DNS redirect to a local package caching server, or a similar solution?

Also, in the hopes to avoid the XY problem, is there a better solution I am missing?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亽野灬性zι浪 2025-01-31 18:31:51

我最终增加了

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt install -y python3.8 ...

码头

RUN --mount=type=cache,target=/root/.cache/pip pip3 install -r requirements.txt

,这使得该过程减轻了痛苦。

I ended up adding

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt install -y python3.8 ...

and

RUN --mount=type=cache,target=/root/.cache/pip pip3 install -r requirements.txt

to the Dockerfile and that made the process much less painful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文