-
Notifications
You must be signed in to change notification settings - Fork 481
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
Docker build "FROM" Fails to search local images #795
Comments
I'm also seeing this. Dockerfiles that build on non-Mac hosts are failing to find local images on Mac. This is also the case for |
Transferring to buildx repository. |
@wtfbbqhax Looking at your diagnostic I would guess you're using the |
@crazy-max Here's the outputs
bash$ cat ~/.docker/config.json
{
"auths" : {
# Scrubbed
},
"stackOrchestrator" : "swarm",
"credsStore" : "desktop"
} |
@wtfbbqhax I see your example shows
(So the image has Does it work if you reference it using the |
The format you're using looks to be the "shortid" reference, which was deprecated in docker 1.13; see docker/cli#753 |
In my case, I'm not using the shortid. Here's a minimal example: First Dockerfile:
Dockerfile that depends on that locally built image:
With Here's some more info in case it's useful:
|
@vemek are you on an arm64 / apple m1 machine? Wondering if this is the same issue as described in moby/moby#42893 |
Ah, I am indeed. Sorry for the duplicate report here - I did not come across that issue when trying to figure this out. |
No worries! There's too many repositories that are "related in some way", so thanks for reporting the issue. There's definitely some issue there that needs to be looked into. This error should not happen (and if it happens, the error message should give a better clue why the image wasn't found (which - if my analysis on that ticket is correct - would be that it was not able to find a matching os/arch) |
For the |
@thaJeztah Ahh clarity at last. Yes it does work if I use |
Thanks for confirming @wtfbbqhax ! (And glad you were able to resolve your case). I'll check if it's possible to add a warning for this case to the classic builder, and (if possible) a clearer error message for BuildKit (because, as outlined in docker/cli#753, there are no plans to support the |
Actually; trying to reproduce the Build an image: DOCKER_BUILDKIT=0 docker build -t foobar -<<EOF
FROM alpine:latest
RUN echo hello > /world.txt
EOF Find the short image ID: docker image ls --filter reference=foobar
REPOSITORY TAG IMAGE ID CREATED SIZE
foobar latest ec1b305d37b4 13 seconds ago 5.6MB Use that as reference; DOCKER_BUILDKIT=0 docker build -t foobar -<<EOF
FROM foobar:ec1b305d37b4
RUN echo hello > /world.txt
EOF
|
I'm not sure, if there is a history/log of Docker desktop installs I can share it. My current version is 20.10.7 |
Having exactly the same proble and obviously all tickets complaining about this issue are being closed?! Why? I like buildx but this makes it nearly useless! |
... setting |
I'm running into the same thing that @tech-team-rural-mda is. I'm not using buildx … just regular old |
For anyone running in to this in the future, I found that running |
My solution: ARG BUILDPLATFORM=linux/amd64
FROM --platform=${BUILDPLATFORM} image_name According to the docs from https://docs.docker.com/reference/dockerfile/:
In conclusion, if you are building from a host different from the target platform then you should specify the target platform. |
When building containers FROM another container image I've built locally, Docker build is failing to find the image and searching externally. A couple weeks ago, I saw this issue and found the problem was mitigated by disabling build kit (
DOCKER_BUILDKIT=0
) However, this no longer works.Notably, this is a paradigm I've been following for years- I've searched all over dockers documentation and can not find any relevant changes documented.
This is what I'm seeing, The
amd64/wtfbbqhax_runtime
is just an alpine image that I have locally.bash$ docker images | grep amd64 amd64/wtfbbqhax_runtime latest 7b2d02df45e4 3 hours ago 89.1MB
The text was updated successfully, but these errors were encountered: