質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Visual Studio Code

Visual Studio Codeとは、Microsoft社が開発したマルチプラットフォーム対応のテキストエディタです。Visual Studioファミリーの一員でもあります。拡張性とカスタマイズ性が高く、テキストエディタでありながら、IDEと遜色ない機能を備えることができます。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

0回答

4500閲覧

VScode Remote containerに関するエラーについて

Algeot

総合スコア21

Visual Studio Code

Visual Studio Codeとは、Microsoft社が開発したマルチプラットフォーム対応のテキストエディタです。Visual Studioファミリーの一員でもあります。拡張性とカスタマイズ性が高く、テキストエディタでありながら、IDEと遜色ない機能を備えることができます。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2022/09/30 02:29

編集2022/09/30 04:57

お世話になっております.

問題の説明

現在, VScodeのRemote container機能をもとに, 作成した.devcontainerフォルダからコンテナ作成及びコンテナ内部での作業を開始しようと試みています.
VScode上でReopen in Containerを実行したとき, Docker imageの作成にはおそらく成功しているのですが, その後
an error occurred setting up the container
なるエラーが表示され, .devcontainer/devcontainer.jsonを見返すように要求されます.
したがってdevcontainer.jsonに問題があると考えられるのですが, どのように書き直すべきなのか分かりません.

コード

Tree

1└.devcontainer 2 ├── Dockerfile 3 └── devcontainer.json

Dockerfile

1FROM python:3-slim

devcontainer.json

1{ 2 "name": "Python 3", 3 "build": { 4 "dockerfile": "Dockerfile", 5 "context": ".." 6 }, 7 8 "customizations": { 9 "vscode": { 10 "extensions": [ 11 "ms-python.python", 12 "ms-python.vscode-pylance" 13 ] 14 } 15 }, 16 17 "remoteUser": "algeot" 18}

使用環境

WindowsのWSLによってubuntu 20.04を導入しています.

出力されたエラー

Command failed: /home/algeot/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/node /home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/algeot/VScodeProject/Scheduling --workspace-mount-consistency cached --id-label devcontainer.local_folder=\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling --log-level debug --log-format json --config /home/algeot/VScodeProject/Scheduling/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true

Log全文は以下の通りでした.

[53 ms] Remote-Containers 0.251.0 in VS Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7).
[51 ms] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling
[220 ms] Start: Resolving Remote
[238 ms] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling
[382 ms] Start: Run: wsl -d Ubuntu-20.04 -e /bin/sh -c cd '/home/algeot/VScodeProject/Scheduling' && /bin/sh
[391 ms] Start: Run in host: id -un
[450 ms] algeot
[450 ms]
[450 ms] Start: Run in host: cat /etc/passwd
[452 ms] Start: Run in host: echo ~
[453 ms] /home/algeot
[453 ms]
[454 ms] Start: Run in host: test -x '/home/algeot/.vscode-remote-containers/bin/74b1f979648cc44d385a2286793c226e611f59e7/node'
[455 ms]
[455 ms]
[455 ms] Exit code 1
[456 ms] Start: Run in host: test -x '/home/algeot/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/node'
[457 ms]
[457 ms]
[457 ms] Start: Run in host: test -f '/home/algeot/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/node_modules/node-pty/package.json'
[458 ms]
[458 ms]
[458 ms] Start: Run in host: test -f '/home/algeot/.vscode-remote-containers/dist/vscode-remote-containers-server-0.251.0.js'
[459 ms]
[459 ms]
[462 ms] userEnvProbe: loginInteractiveShell (default)
[463 ms] userEnvProbe shell: /bin/bash
[557 ms] userEnvProbe PATHs:
Probe: > '/home/algeot/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/w32tex/bin:/mnt/c/Program Files (x86)/gs/gs9.50/bin:/mnt/c/Program Files (x86)/gs/gs9.50/lib:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/texlive/2022/bin/win32:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/81909/anaconda3:/mnt/c/Users/81909/anaconda3/Library/mingw-w64/bin:/mnt/c/Users/81909/anaconda3/Library/usr/bin:/mnt/c/Users/81909/anaconda3/Library/bin:/mnt/c/Users/81909/anaconda3/Scripts:/mnt/c/Users/81909/AppData/Local/Programs/Python/Python39/Scripts/:/mnt/c/Users/81909/AppData/Local/Programs/Python/Python39/:/mnt/c/Users/81909/AppData/Local/Microsoft/WindowsApps:/mnt/c/texlive/2016/bin/win32:/mnt/c/Users/81909/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin'
Container: None
[558 ms] Setting up container for folder or workspace: /home/algeot/VScodeProject/Scheduling
[560 ms] Start: Check Docker is running
[560 ms] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[631 ms] Server API version: 1.41
[632 ms] Start: Run in Host: docker volume ls -q
[712 ms] Start: Run in Host: docker ps -q -a --filter label=vsch.local.folder=\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling --filter label=vsch.quality=stable
[784 ms] Start: Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling
[873 ms] Start: Run in Host: docker inspect --type container a99264b9f98e
[950 ms] Start: Run in Host: /home/algeot/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/node /home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/algeot/VScodeProject/Scheduling --workspace-mount-consistency cached --id-label devcontainer.local_folder=\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling --log-level debug --log-format json --config /home/algeot/VScodeProject/Scheduling/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[1053 ms] remote-containers 0.251.0.
[1052 ms] Start: Run: docker buildx version
[1164 ms] Start: Resolving Remote
[1167 ms] Start: Run: git rev-parse --show-cdup
[1171 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling
[1241 ms] Start: Run: docker inspect --type container a99264b9f98e
[1316 ms] Start: Inspecting container
[1316 ms] Start: Run: docker inspect --type container a99264b9f98e7307eb216b468cad87a8716536c50df7e66351e8c9feb50e5bc5
[1392 ms] Start: Run in container: /bin/sh
[1394 ms] Start: Run in container: uname -m
[1484 ms] Shell server terminated (code: 126, signal: null)
[1484 ms] unable to find user algeot: no matching entries in passwd file
[1484 ms] Start: Run in container: cat /etc/passwd
[1485 ms] Stdin closed!
[1485 ms] Error: An error occurred setting up the container.
[1486 ms] at SF (/home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js:257:2186)
[1486 ms] at pb (/home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js:257:2124)
[1486 ms] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[1486 ms] at async DF (/home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js:263:2006)
[1486 ms] at async to (/home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js:263:3110)
[1486 ms] at async Ak (/home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js:383:8108)
[1486 ms] at async Ok (/home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js:383:7864)
[1489 ms] Exit code 1

ここから抽出部分 (この部分のみ赤字でした)

[1493 ms] Command failed: /home/algeot/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/node /home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/algeot/VScodeProject/Scheduling --workspace-mount-consistency cached --id-label devcontainer.local_folder=\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling --log-level debug --log-format json --config /home/algeot/VScodeProject/Scheduling/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true

ここまで.

[1493 ms] Exit code 1

宜しくお願い致します.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Algeot

2022/09/30 02:32

エラーコードの記載を忘れておりました. 申し訳ありません. Command failed: /home/algeot/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/node /home/algeot/.vscode-remote-containers/dist/dev-containers-cli-0.251.0/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/algeot/VScodeProject/Scheduling --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\algeot\VScodeProject\Scheduling --log-level debug --log-format json --config /home/algeot/VScodeProject/Scheduling/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
m.ts10806

2022/09/30 03:12

質問は編集できます。 また、ツールの使い方にも関わってきそうなので質問タグ「Visual Studio Code」を追加しておいてください。
Algeot

2022/09/30 03:49

ご指摘ありがとうございます. タグの方はvscodeで検索しても出ないもので諦めておりました.
m.ts10806

2022/09/30 03:49

基本は正式名称ですね。
Algeot

2022/09/30 03:51

仰る通りです.
yamap55

2022/09/30 04:38

多分このエラーの前後にもう少し情報が出ているかと思います。そこを追記いただけますでしょうか。
Algeot

2022/09/30 05:00

追記いたしました. 宜しくお願い致します.
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問