You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're working with a JavaScript-based monorepo that includes around 15 applications sharing approximately 10 packages. Each application is launched as a Docker Compose service using a common app image. This image is built locally and installs all the necessary apps and dependencies. For development, we use Docker Compose to mount the source code of each service and synchronize the shared packages.
Here's a snippet of our Dockerfile and the relevant part of our docker-compose.yml:
My Question:
Is there a more streamlined way to handle this scenario? It seems like a common situation, but our current solution feels somewhat makeshift. Any insights, experiences, or suggestions for improving our Docker build process in a monorepo setup would be greatly appreciated!
Thank you in advance for your help!
Edit
It seems to me that Docker builder might not actually be performing concurrent builds of shared layers between the build contexts. For instance, when 15 services require RUN pnpm install, it appears to happen just once. Yet, I'm not completely sure if this is accurate. Could someone point me to relevant documentation or source code that confirms how docker builder and compose handles this ? While I'm quite content with the current efficiency of our build process, I'm still interested in learning how others tackle similar challenges in their Docker setups.
Any clarification or shared experiences in optimizing Docker builds in a monorepo environment would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We're working with a JavaScript-based monorepo that includes around 15 applications sharing approximately 10 packages. Each application is launched as a Docker Compose service using a common
app
image. This image is built locally and installs all the necessary apps and dependencies. For development, we use Docker Compose to mount the source code of each service and synchronize the shared packages.Here's a snippet of our Dockerfile and the relevant part of our docker-compose.yml:
app
the DockerfileCompose:
My Question:
Is there a more streamlined way to handle this scenario? It seems like a common situation, but our current solution feels somewhat makeshift. Any insights, experiences, or suggestions for improving our Docker build process in a monorepo setup would be greatly appreciated!
Thank you in advance for your help!
Edit
It seems to me that Docker builder might not actually be performing concurrent builds of shared layers between the build contexts. For instance, when 15 services require
RUN pnpm install
, it appears to happen just once. Yet, I'm not completely sure if this is accurate. Could someone point me to relevant documentation or source code that confirms how docker builder and compose handles this ? While I'm quite content with the current efficiency of our build process, I'm still interested in learning how others tackle similar challenges in their Docker setups.Any clarification or shared experiences in optimizing Docker builds in a monorepo environment would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions