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

devcontainer build returns 0 even after failure #144

Closed
tschaffter opened this issue Aug 28, 2022 · 2 comments
Closed

devcontainer build returns 0 even after failure #144

tschaffter opened this issue Aug 28, 2022 · 2 comments

Comments

@tschaffter
Copy link

tschaffter commented Aug 28, 2022

Building a Dockerfile that includes an error - e.g. "forget" \ at the end of a continuation line - fails but devcontainer returns the success code (0).

$ devcontainer build --image-name sagebionetworks/challenge-devcontainer:test
[497 ms] Start: Run in Host: /home/tschaffter/.vscode-remote-containers/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node /home/tschaffter/.vscode-remote-containers/dist/dev-containers-cli-0.245.2/dist/spec-node/devContainersSpecCLI.js build --workspace-folder /home/tschaffter/dev2/tschaffter/challenge-registry/tools/devcontainers/challenge-devcontainer --log-level info --log-format json --image-name sagebionetworks/challenge-devcontainer:test
[581 ms] remote-containers 0.245.2.
[712 ms] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/vsch-tschaffter/container-features/0.245.2-1661698018485/Dockerfile-with-features -t sagebionetworks/challenge-devcontainer:test --target dev_containers_target_stage --build-arg imageVersion=bullseye-20211220-slim --build-arg devcontainerVersion= --build-context dev_containers_feature_content_source=/tmp/vsch-tschaffter/container-features/0.245.2-1661698018485 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/tschaffter/dev2/tschaffter/challenge-registry/tools/devcontainers/challenge-devcontainer/.devcontainer
[+] Building 1.1s (6/6) FINISHED                                                
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 3.44kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4               0.8s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:443aab4c  0.0s
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => [internal] load .dockerignore                                          0.0s
error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = dockerfile parse error on line 58: unknown instruction: &&
[2169 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/vsch-tschaffter/container-features/0.245.2-1661698018485/Dockerfile-with-features -t sagebionetworks/challenge-devcontainer:test --target dev_containers_target_stage --build-arg imageVersion=bullseye-20211220-slim --build-arg devcontainerVersion= --build-context dev_containers_feature_content_source=/tmp/vsch-tschaffter/container-features/0.245.2-1661698018485 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/tschaffter/dev2/tschaffter/challenge-registry/tools/devcontainers/challenge-devcontainer/.devcontainer
[2169 ms]     at HS (/home/tschaffter/.vscode-remote-containers/dist/dev-containers-cli-0.245.2/dist/spec-node/devContainersSpecCLI.js:256:1490)
[2169 ms]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[2169 ms]     at async Cu (/home/tschaffter/.vscode-remote-containers/dist/dev-containers-cli-0.245.2/dist/spec-node/devContainersSpecCLI.js:255:2801)
[2170 ms]     at async $P (/home/tschaffter/.vscode-remote-containers/dist/dev-containers-cli-0.245.2/dist/spec-node/devContainersSpecCLI.js:360:12358)
[2170 ms]     at async jP (/home/tschaffter/.vscode-remote-containers/dist/dev-containers-cli-0.245.2/dist/spec-node/devContainersSpecCLI.js:360:10865)
[2173 ms] Exit code 1

$ echo $?
0

I initially spotted the issue in our CI workflow, which was not stopping after devcontainer build had failed.

@joshspicer
Copy link
Member

Thanks for the issue. I think this is also only repro'ing the "vscode" edition of the CLI (#145 (comment))

@chrmarti
Copy link
Contributor

chrmarti commented Sep 6, 2022

This is fixed in the latest versions of Remote-Containers (0.251.0 and 0.252.0-pre-release).

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

3 participants