How to build docker images in a lerna monorepo without publishing

你离开我真会死。 提交于 2020-01-04 02:43:49

问题


The use case for this is branch building and deployments in Lerna monorepos.

The problem is that Lerna monorepos either hoist dependencies in NPM or use yarn workspaces to the same effect to collect all dependencies in the node_modules folder of the workspace/monorepo. Which means that they will not be accessible when building Dockerfiles in subfolders due to how docker build contexts work.

I imagine what is needed here is a kind of "lower" (as opposed to hoist) function to pull package dependencies into the node_modules of the Docker/package.json project before running docker build.

The question is, does anyone have a better idea, or know of an already existing method to do this?

来源:https://stackoverflow.com/questions/59320343/how-to-build-docker-images-in-a-lerna-monorepo-without-publishing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!