I'm having a very difficult time getting Skaffold to work with my monorepo, and I see zero documentation, blogs, guides, etc addressing the use of Skaffold and monorepos. The precious few examples I've seen have no shared packages in the monorepo, meaning they aren't helpful at all.
The issue is that my Dockerfiles need to be built from the root of the monorepo in order to grab shared packages and to determine the exact files needed for a particular application. I handle the latter by using turbo repo's "prune" command, which is working great. In order for this to work though, it needs access to the entire monorepo, meaning one of the first things I do in any app's Dockerfile is "COPY . ." from the root. Turbo's prune can then build a package-lock.json and a list of the exact files I need specifically for that app, so I can then run an "npm ci" and build that particular app in subsequent stages in the Dockerfile.
The problem is that setting context to "." in my skaffold.yaml for every app causes every app to get rebuilt when any file changes anywhere in the monorepo.
Is there a way to more manually customize how/when a build is triggered for an app and still run my docker build from the root of my monorepo?
Please help. I've spent several days working on this to no avail. It makes me think anyone using monorepos with one or more shared packages simply abandons the use of Skaffold, which I am close to doing.