Open jingxiaolu opened 4 years ago
Dockerfile:
FROM alpine RUN exit 1
Build log:
# buildctl build --frontend dockerfile.v0 --local dockerfile=. --local context=. --output type=oci,dest=`pwd`/oci.tar [+] Building 7.9s (5/5) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 60B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/alpine:latest 7.8s => CACHED [1/2] FROM docker.io/library/alpine@sha256:2171658620155679240babee0a7714f6509fae66898db422ad803b951257db78 0.0s => => resolve docker.io/library/alpine@sha256:2171658620155679240babee0a7714f6509fae66898db422ad803b951257db78 0.0s => ERROR [2/2] RUN exit 1 0.1s ------ > [2/2] RUN exit 1: ------ error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c exit 1]: buildkit-runc did not terminate sucessfully # ls -al total 12 drwxr-xr-x 2 root root 4096 Dec 30 11:21 . drwxr-xr-x 11 root root 4096 Dec 30 11:20 .. -rw-r--r-- 1 root root 23 Dec 30 11:20 Dockerfile -rw-rw-rw- 1 root root 0 Dec 30 11:21 oci.tar # tar -xvf oci.tar tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors
Tarball also left with tarball exporter and docker tarball:
buildctl build --frontend dockerfile.v0 --local dockerfile=. --local context=. --output type=tar,dest=tar.tar
buildctl build --frontend dockerfile.v0 --local dockerfile=. --local context=. --output type=docker,dest=docker.tar
Versions:
# buildctl -v buildctl github.com/moby/buildkit v0.6.1-165-g8e4ab0b 8e4ab0b04e97d2e594bea0a1ea33cdcf8b3d67df # buildkitd -v buildkitd github.com/moby/buildkit v0.6.1-165-g8e4ab0b 8e4ab0b04e97d2e594bea0a1ea33cdcf8b3d67df
I think buildctl should delete the lefted oci.tar when building failed. Please share your comments~
oci.tar
Deleting SGTM, could you open PR?
OK, I'll push a PR. Thanks~
Dockerfile:
Build log:
Tarball also left with tarball exporter and docker tarball:
buildctl build --frontend dockerfile.v0 --local dockerfile=. --local context=. --output type=tar,dest=tar.tar
buildctl build --frontend dockerfile.v0 --local dockerfile=. --local context=. --output type=docker,dest=docker.tar
Versions:
I think buildctl should delete the lefted
oci.tar
when building failed. Please share your comments~