Skip to content

"No output specified for" warning should be handled for named contexts #968

Closed

Description

Warning for no output specified should not be displayed if named context input is being used as dependency for another target that has a defined output:

# docker-bake.hcl

target "base" {
  dockerfile = "baseapp.Dockerfile"
  args = {
    basefoo = "bar"
  }
}

target "app" {
  contexts = {
    baseapp = "target:base"
  }
}
# Dockerfile
FROM baseapp
RUN echo "Hello world"
# baseapp.Dockerfile
FROM alpine
WORKDIR /src
$ docker buildx bake --set app.tags=user/app:latest --set app.output=type=cacheonly app
...
#12 [app 1/2] RUN echo "Hello world"
#12 CACHED
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load

Not linked to this issue but if len(opt) > 1 we should display the target name in the warning message.

cc @tonistiigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions