Support shared content during build
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 72.1k
- Forks
- 19.2k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 164
Description
Description
It would be helpful to have a Docker-managed means to share files across build instead in a way that allows for temporary containers to do some up-front work to better support monorepo structures, similar to how volumes are for content used at runtime.
Example: Say you have a monorepo with two packages, client and server. At the repo root you define your workspaces and when you run an install node_modules and the lockfile are only generated at the repo root and dependencies are deduplicated in both resulting in performance improvements.
Ideally you'd like to have a docker compose setup with these steps
- Run install with a frozen lockfile for security in a temporary container
- Save off the generated
node_modulescontent - Allow your temporary container to exit
- Start your
depends_onwith conditionservice_completed_successfullyservices that need thosenode_modulesand reference that saved off content
Since your first image needs to complete and exit, you cannot use COPY --from=build-stage because that container is already stopped, so there's no good way to share those files with subsequent image build, unless you use a bind mount. If we had something fully managed by Docker during build (like how volumes are for runtime sharing across images) which was guaranteed to be temporary and not need to interact with the local filesystem directly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files or tests. Start by examining the existing Docker build behavior around COPY --from and bind mounts, then compare it with Docker Compose's service_completed_successfully flow. Done would require a defined temporary, Docker-managed mechanism for sharing generated build content across these stages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, node.js
- Domain
- build-system, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100