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 does not show target stage for COPY --link #1195

Closed
ciaranmcnulty opened this issue Jul 3, 2022 · 5 comments · Fixed by #1305
Closed

Bake does not show target stage for COPY --link #1195

ciaranmcnulty opened this issue Jul 3, 2022 · 5 comments · Fixed by #1305

Comments

@ciaranmcnulty
Copy link

ciaranmcnulty commented Jul 3, 2022

When I build multiple targets (e.g. via a group or explicitly) it's not often clear which target a build(ing) stage corresponds to

sample log
Dockerfile

The build steps that don't have a TARGET name are the ones that do COPY --link, but not all of the them are missing it.

I'm not clear what is happening behind the scenes to cause this!

@jedevc
Copy link
Collaborator

jedevc commented Jul 4, 2022

I assume you mean like here?

#78 [debian php-configured  8/19] RUN php -m | grep ast
#78 CACHED

#79 [php-configured  7/19] COPY --link <<EOF /usr/local/etc/php/conf.d/phpqa.ini
#79 CACHED

Could you share what your bake file looks like, or a minimal reproduction? 😄 Sorry, I'm having a tricky time parsing the exact issue you're spotting 👀

@ciaranmcnulty
Copy link
Author

That's a good example where the debian target is present in one line and not the other

@ciaranmcnulty
Copy link
Author

ciaranmcnulty commented Aug 5, 2022

I'm not sure if this is the same issue but I today got this output from a bake:

[Edit: removed loads of detail]

@ciaranmcnulty
Copy link
Author

This is reproducible without the cache stuff actually so ignore the detail above!

services:
  localstack:
    build:
      context: .
  other:
    build:
      context: ./other
# syntax=docker/dockerfile:1.4
FROM localstack/localstack:0.14.5
COPY --link docker-entrypoint-initaws.d /docker-entrypoint-initaws.d

other/Dockerfile is just FROM scratch

docker buildx bake --pull --no-cache:

[+] Building 2.0s (14/14) FINISHED                                                                                                                                                                                                                                                                                      
 => [localstack internal] load build definition from Dockerfile                                                                                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 173B                                                                                                                                                                                                                                                                               0.0s
 => [localstack internal] load .dockerignore                                                                                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                    0.0s
 => [other internal] load build definition from Dockerfile                                                                                                                                                                                                                                                         0.0s
 => => transferring dockerfile: 50B                                                                                                                                                                                                                                                                                0.0s
 => [other internal] load .dockerignore                                                                                                                                                                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                    0.0s
 => [localstack] resolve image config for docker.io/docker/dockerfile:1.4                                                                                                                                                                                                                                          1.3s
 => [auth] docker/dockerfile:pull token for registry-1.docker.io                                                                                                                                                                                                                                                   0.0s
 => CACHED [localstack] docker-image://docker.io/docker/dockerfile:1.4@sha256:443aab4ca21183e069e7d8b2dc68006594f40bddf1b15bbd83f5137bd93e80e2                                                                                                                                                                     0.0s
 => => resolve docker.io/docker/dockerfile:1.4@sha256:443aab4ca21183e069e7d8b2dc68006594f40bddf1b15bbd83f5137bd93e80e2                                                                                                                                                                                             0.0s
 => [localstack internal] load metadata for docker.io/localstack/localstack:0.14.5                                                                                                                                                                                                                                 0.4s
 => [auth] localstack/localstack:pull token for registry-1.docker.io                                                                                                                                                                                                                                               0.0s
 => [localstack internal] load build context                                                                                                                                                                                                                                                                       0.0s
 => => transferring context: 104B                                                                                                                                                                                                                                                                                  0.0s
 => [localstack 1/2] FROM docker.io/localstack/localstack:0.14.5@sha256:2f44dbb2af684c498892cfd6e493f2fea177edbf53322e0d6b28c28f32a454fb                                                                                                                                                                           0.0s
 => => resolve docker.io/localstack/localstack:0.14.5@sha256:2f44dbb2af684c498892cfd6e493f2fea177edbf53322e0d6b28c28f32a454fb                                                                                                                                                                                      0.0s
 => CACHED [2/2] COPY --link docker-entrypoint-initaws.d /docker-entrypoint-initaws.d      

The [2/2] doesn't say which target it belongs to

@ciaranmcnulty
Copy link
Author

And to confirm, if I remove --link that stage says [localstack 2/2]

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

Successfully merging a pull request may close this issue.

3 participants