The buildkit error messages have gotten really bad. They look like this:
foo โ โ [6/8] COPY src/js/lib /opt/app/src/js/lib
foo โ โ
foo โ โ ERROR IN: [6/8] COPY src/js/lib /opt/app/src/js/lib
foo โ โ
foo โ โ ERROR IN: [1/8] FROM docker.io/library/node:10@sha256:dabc15ad36a9e0a95862fbdf6ffdad439edc20aa27c7f10456644464e3fb5f08
foo โ โ
foo โ โ ERROR IN: [6/8] COPY src/js/lib /opt/app/src/js/lib
foo โ
foo โ ERROR: ImageBuild: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/src/js/lib" not found: not found
foo โ got unexpected error during build/deploy: ImageBuild: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/src/js/lib" not found: not found
Build Failed: ImageBuild: failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/src/js/lib" not found: not found
as reported in this comment. They're so bad that people are getting confused and think it's a Tilt bug.
We should clean up this error message. This might involve fixes to docker/buildkit upstream, or just working around it in Tilt, depending on how easy it is.
I can spot at least 4 things wrong with this error message:
1) The text "got unexpected error during build/deploy" is misleading. It implies that this is a Tilt error instead of a normal build failure.
2) The "failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key" are all internal buildkit details that should probably be unwrapped/stripped out
3) The tilt output isn't clearly identifying which step of the build failed
4) The error appears 3 times in different formats
FWIW all of the above bullets except the "failed to compute cache key" part and the end of #2 seem to apply to all build failures, not just missing file errors.
In case it helps somebody in the future:
My .dockerignore had an entry for target (Rust's build directory) and I was getting errors about files in /var/lib/docker/tmp/buildkit-.../target/debug not existing.
Removing target from .dockerignore fixed the problem. The error messages are not helpful. Telling me something like "you are trying to COPY files from an ignored directory" would have helped immensely.
Not blaming tilt though. That's definitely on Docker.
Most helpful comment
In case it helps somebody in the future:
My
.dockerignorehad an entry fortarget(Rust's build directory) and I was getting errors about files in/var/lib/docker/tmp/buildkit-.../target/debugnot existing.Removing
targetfrom.dockerignorefixed the problem. The error messages are not helpful. Telling me something like "you are trying toCOPYfiles from an ignored directory" would have helped immensely.Not blaming
tiltthough. That's definitely on Docker.