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

Bake complains about result only in build cache, even if it's used #1146

Closed
ciaranmcnulty opened this issue May 27, 2022 · 1 comment
Closed

Comments

@ciaranmcnulty
Copy link

ciaranmcnulty commented May 27, 2022

We have an old site that builds a deployment asset and I'm containerising it.

I defined 2 targets (with different Dockerfiles); one that spits out the deployable package onto disk to fit into the old deployment method, and another that builds a web container consuming that package:

target "build" {
    # [...]
    output = [
        "./build",
    ]
}

target "web" {
    # [...]
    contexts = {
        deploy-package = "target:build"
    }
    tags = [
        "myorg/web",
    ]
}

When I build the web target:

docker buildx build web --load --push

Because the build target is built I get this confusing mix of messages in the log:

 => => exporting layers                                                                                                                                                0.0s
 => => exporting manifest sha256:d6c864e28edcf8d0efc9439b16e64348b6cdc9fc16cdbe98556a1acdaa1ff960                                                                      0.0s
 => => exporting config sha256:e8dfdb36d627783b7e6a457043ac5fca6c364d90b29444e56780d962228c5c19                                                                        0.0s
 => => sending tarball                                                                                                                                                11.4s
 => importing to docker                                                                                                                                                0.0s
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

Building the deploy target directly doesn't warn (because it has a file output)

I think the mechanism that triggers a build because of the additional build context should be suppressing that warning.

@crazy-max
Copy link
Member

@ciaranmcnulty Yes this is a known issue, see #968

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

No branches or pull requests

2 participants