-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Docker Compose supports additional_contexts with service: syntax to reference another service's build output as a build context. This works with docker compose build (or docker bake) but fails with depot bake.
This pattern is useful for monorepos where multiple services share a common base image with pre-built dependencies. The base is built once and reused by all app images.
Minimal reproduction
services:
base:
image: example-base
build:
dockerfile_inline: |
FROM alpine AS base
RUN echo "base"
app:
image: example-app
build:
dockerfile_inline: |
FROM base
RUN echo "app"
additional_contexts:
base: service:base# Works
docker bake
# Fails
depot bakeError
Error: failed to get build context base: stat service:base: no such file or directory
Expected behavior
Depot should resolve service:base to the build output of the base service, matching docker compose build behavior.
Metadata
Metadata
Assignees
Labels
No labels