Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
crazy-max opened this issue Feb 25, 2022 · 1 comment · Fixed by #1148
Closed

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

crazy-max opened this issue Feb 25, 2022 · 1 comment · Fixed by #1148

Comments

@crazy-max
Copy link
Member

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

@tonistiigi
Copy link
Member

Yeah, either show warning if none of the targets have exports or if some of the targets set by the user don't have exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants