project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.42k stars 1.99k forks source link

Can NOT build the docker image[Build] #29545

Open WymanSo opened 1 year ago

WymanSo commented 1 year ago

Build issue(s)

  1. my system is Win10 + WSL2(ubuntu22) + docker

2.now I download the whole project and load into the VS code, then the VS tell me install the extension "Dev containers". the installation is ok, next then build the image for docker. but always get the fault message. the partial logs as below:

  1. So how to resolve? pls help me. It took me 3days, but always fail ...

Platform

vscode, windows

Anything else?

[6891 ms] Start: Run: /bin/sh -c .devcontainer/build.sh --tag matter-dev-environment:local --version 1 [+] Building 2.5s (7/9) docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 3.29kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for ghcr.io/project-chip/chip-build-vscode:1 2.3s => [1/6] FROM ghcr.io/project-chip/chip-build-vscode:1@sha256:c8a177b97e 0.0s => CACHED [2/6] RUN apt-get update && apt-get install -y locales 0.0s => CACHED [3/6] RUN groupadd -g 1000 vscode && useradd -s /bin/bash 0.0s => ERROR [4/6] RUN curl https://raw.githubusercontent.com/restyled-io/re 0.2s


[4/6] RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /usr/local/bin/restyle-path && chmod +x /usr/local/bin/restyle-path && :: 0.184 % Total % Received % Xferd Average Speed Time Time Time Current 0.184 Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0.200 curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

Dockerfile:51

50 |
51 | >>> RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /usr/local/bin/restyle-path \ 52 | >>> && chmod +x /usr/local/bin/restyle-path \ 53 | >>> && : 54 |

ERROR: failed to solve: process "/bin/sh -c curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /usr/local/bin/restyle-path && chmod +x /usr/local/bin/restyle-path && :" did not complete successfully: exit code: 7 [9983 ms] Error: Command failed: /bin/sh -c .devcontainer/build.sh --tag matter-dev-environment:local --version 1 [9983 ms] at vK (/home/whitemanso/.vscode-remote-containers/dist/dev-containers-cli-0.314.0/dist/spec-node/devContainersSpecCLI.js:479:15) [9983 ms] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [9983 ms] at async SAA (/home/whitemanso/.vscode-remote-containers/dist/dev-containers-cli-0.314.0/dist/spec-node/devContainersSpecCLI.js:479:3522) [9984 ms] at async GC (/home/whitemanso/.vscode-remote-containers/dist/dev-containers-cli-0.314.0/dist/spec-node/devContainersSpecCLI.js:479:4775) [9984 ms] at async ZeA (/home/whitemanso/.vscode-remote-containers/dist/dev-containers-cli-0.314.0/dist/spec-node/devContainersSpecCLI.js:611:12251) [9984 ms] at async VeA (/home/whitemanso/.vscode-remote-containers/dist/dev-containers-cli-0.314.0/dist/spec-node/devContainersSpecCLI.js:611:11992) [9990 ms] Exit code 1 [9992 ms] Command failed: /home/whitemanso/.vscode-remote-containers/bin/fdb98833154679dbaa7af67a5a29fe19e55c2b73/node /home/whitemanso/.vscode-remote-containers/dist/dev-containers-cli-0.314.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-5baff7d5-a0eb-4c93-b67c-a049d5d69ac91696335546406 --workspace-folder /mnt/d/connectedhomeip_master --workspace-mount-consistency cached --id-label devcontainer.local_folder=d:\connectedhomeip_master --id-label devcontainer.config_file=/mnt/d/connectedhomeip_master/.devcontainer/devcontainer.json --log-level debug --log-format json --config /mnt/d/connectedhomeip_master/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=/run/user/1000/wayland-0,target=/tmp/vscode-wayland-166821c0-9fa5-42b0-ac60-5a7df7ad32fc.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root [9992 ms] Exit code 1

lmatter commented 8 months ago

I think the problem might be that there does not seem to be a setting for "terminal.integrated.shell.windows": in VSCode any longer and (at least for me) it's trying to use powershell to run build.sh. I changed the defaulit profile to bash(wsl) but it didn't help. A workaround could be to clone the repo inside wsl and trying to open the folder in VScode using \wsl path causes it to switch to wsl, THEN it tries to switch to docker, which gets farther. Trying it now, will update. [update] Seems hung on step 5/6 (or can't start 6). No containers running.