在集装箱应用程序中升级包装

发布于 2025-01-25 20:59:15 字数 253 浏览 3 评论 0原文

II希望在docker容器中更新package.json(next.js project)的纱线包。我在Docker文件中看到了我们运行的纱线安装-Frozen-Lockfile 对于这个项目,还有一个与其他容器合作的码头。

你会怎么做?我的第一次尝试是运行docker构成然后纱线升级'软件包',但是我遇到了与软件包无关的错误,就像我在环境上运行新的纱线安装一样。

I I would like to update a Yarn package inside package.json (Next.js project) within a docker container. I saw that inside the docker file we run yarn install --frozen-lockfile
For this project there is also a docker compose with other containers.

How would you do that? My first try was to run the docker compose up then yarn upgrade 'package' but I got errors not related to the package like I am running a new yarn install on my environment.

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

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

发布评论

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

评论(1

怼怹恏 2025-02-01 20:59:15

当您升级任何内容时,总是建议不要在实时/运行容器上进行操作。取而代之的是,建议您更新要在源代码和Dockerfile中更新的内容,然后在您的情况下使用Docker-Compose创建新版本,然后在旧图像上部署新图像。

这就是最佳实践正在努力。如果可能的话,建议您走这条路线。

When you are upgrading anything it is always recommended NOT to do it on the live/running container. Instead, it is recommended you update what you want to update in your source code and Dockerfile and then create a NEW version of the image and deploy the new image over the old one with docker-compose in your case.

That's what best practice is striving towards. If this is possible it is recommended you go this route.

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