在集装箱应用程序中升级包装
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您升级任何内容时,总是建议不要在实时/运行容器上进行操作。取而代之的是,建议您更新要在源代码和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.