Hello,
I have a monorepo with multiple modules that I recently converted to a workspace.
Since there are many modules, each module’s Dockerfile is set up to only contain its own code and any dependencies within the monorepo.
This poses an issue as the go.work file lists all the modules, and attempting to build a single module with the full go.work file errors out as some modules are missing.
I’m not keen on including the entire monorepo in the builds of individual modules, since most of the time each module only depends on one other module.
Is there a suggestion other than manually editing the go.work file within each module’s Dockerfile?
Thanks, example below:
EXAMPLE
3 modules, a and b both depend on common.
— go.work
use ./common
use ./a
use ./b
— a.Dockerfile
cp go.work .
cp ./common ./common
cp ./a ./a
Building a.Dockerfile fails as go.work expects module b to exist.