devcontainers / devcontainers/features

python feature not compatible with alpine - better error message

Open
#498 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
1.5k
Forks
621
Avg merge
2d 11h
Merged PRs (30d)
4

Description

This is my devcontainer.json:
```json
{
"name": "Alpine",
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.17",
"features": {
"jupyterlab": "latest"
}
}
```

Opening the dev container produces the following error:

```
#0 0.453 Feature : Python
#0 0.453 Description : Installs the provided version of Python, as well as PIP
X, and other common Python utilities. JupyterLab is conditionally installed wit
h the python feature. Note: May require source code compilation.
#0 0.453 Id : ghcr.io/devcontainers/features/python
#0 0.453 Version : 1.0.22
#0 0.453 Documentation : https://github.com/devcontainers/features/tree/main/src
/python
#0 0.453 Options :
#0 0.453 VERSION="os-provided"
#0 0.453 INSTALLTOOLS="true"
#0 0.453 OPTIMIZE="false"
#0 0.453 INSTALLPATH="/usr/local/python"
#0 0.453 INSTALLJUPYTERLAB="true"
#0 0.453 CONFIGUREJUPYTERLABALLOWORIGIN=""
#0 0.453 =======================================================================
====
#0 0.461 find: /var/lib/apt/lists/*: No such file or directory
#0 0.461 Running apt-get update...
#0 0.462 ./install.sh: line 190: apt-get: command not found
#0 0.462 ERROR: Feature "Python" (ghcr.io/devcontainers/features/python) failed
to install! Look at the documentation at https://github.com/devcontainers/featur
es/tree/main/src/python for help troubleshooting this error.
------
ERROR: failed to solve: executor failed running [/bin/sh -c cp -ar /tmp/build-fe
atures-src/python_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-conta
iner-features/python_1 && cd /tmp/dev-container-features/python_1 && chmod +x
./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm
-rf /tmp/dev-container-features/python_1]: exit code: 127
[2023-03-21T14:29:13.133Z] Stop (11226 ms): Run: docker buildx build --load --build-context dev_containers_feature_content_source=C:\Users\HDIETE~1\AppData\Local\Temp\devcontainercli\container-features\0.35.0-1679408939387 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:alpine-3.17 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-empty-10-1f396861a10f128c309c552ae61065dd99209e8c7e4251e759728873139538a1-features -f C:\Users\HDIETE~1\AppData\Local\Temp\devcontainercli\container-features\0.35.0-1679408939387\Dockerfile.extended c:\Users\hdieterichs\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-containers\data\empty-folder
[2023-03-21T14:29:13.134Z] Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=C:\Users\HDIETE~1\AppData\Local\Temp\devcontainercli\container-features\0.35.0-1679408939387 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:alpine-3.17 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-empty-10-1f396861a10f128c309c552ae61065dd99209e8c7e4251e759728873139538a1-features -f C:\Users\HDIETE~1\AppData\Local\Temp\devcontainercli\container-features\0.35.0-1679408939387\Dockerfile.extended c:\Users\hdieterichs\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-containers\data\empty-folder
[2023-03-21T14:29:13.135Z] at bse (c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js:1916:3264)
[2023-03-21T14:29:13.135Z] at J7 (c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js:1916:3200)
[2023-03-21T14:29:13.135Z] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-03-21T14:29:13.135Z] at async $se (c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js:1931:2626)
[2023-03-21T14:29:13.135Z] at async Ah (c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js:1931:3741)
[2023-03-21T14:29:13.135Z] at async aae (c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js:2059:17376)
[2023-03-21T14:29:13.136Z] at async oae (c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js:2059:17117)
[2023-03-21T14:29:13.148Z] Stop (16594 ms): Run: C:\Users\hdieterichs\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe --ms-enable-electron-run-as-node c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\hdieterichs\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-d604bc2e-4ea1-4b4f-b4ea-ad09f82488671679408921808 --workspace-folder c:\dev\temp\empty-10 --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\dev\temp\empty-10 --id-label devcontainer.config_file=c:\dev\temp\empty-10\.devcontainer\devcontainer.json --log-level debug --log-format json --config c:\dev\temp\empty-10\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=\\wsl.localhost\Ubuntu\mnt\wslg\runtime-dir\wayland-0,target=/tmp/vscode-wayland-127d2c1e-b7f4-4bb9-8cd7-636dd4794297.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-03-21T14:29:13.148Z] Exit code 1
[2023-03-21T14:29:13.153Z] Command failed: C:\Users\hdieterichs\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe --ms-enable-electron-run-as-node c:\Users\hdieterichs\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.286.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\hdieterichs\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-d604bc2e-4ea1-4b4f-b4ea-ad09f82488671679408921808 --workspace-folder c:\dev\temp\empty-10 --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\dev\temp\empty-10 --id-label devcontainer.config_file=c:\dev\temp\empty-10\.devcontainer\devcontainer.json --log-level debug --log-format json --config c:\dev\temp\empty-10\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=\\wsl.localhost\Ubuntu\mnt\wslg\runtime-dir\wayland-0,target=/tmp/vscode-wayland-127d2c1e-b7f4-4bb9-8cd7-636dd4794297.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-03-21T14:29:13.153Z] Exit code 1
```

The error `#0 0.462 ./install.sh: line 190: apt-get: command not found` sounds like the user did something wrong.

It would be much more helpful to get a clear error message saying that the python feature does not support the alpine distro.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.