├── .devcontainer └── devcontainer.json ├── .github └── workflows │ ├── docker-in-docker-stress-test.yaml │ ├── linter-automated.yaml │ ├── linter-manual.yaml │ ├── release.yaml │ ├── test-all.yaml │ ├── test-manual.yaml │ ├── test-pr.yaml │ ├── update-aws-cli-completer-scripts.yml │ ├── update-documentation.yml │ ├── update-dotnet-install-script.yml │ └── validate-metadata-files.yml ├── .gitignore ├── .vscode └── launch.json ├── CODEOWNERS ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── src ├── anaconda │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── aws-cli │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ ├── install.sh │ └── scripts │ │ ├── fetch-latest-completer-scripts.sh │ │ └── vendor │ │ ├── README.md │ │ ├── aws_bash_completer │ │ └── aws_zsh_completer.sh ├── azure-cli │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── common-utils │ ├── NOTES.md │ ├── README.md │ ├── bin │ │ ├── code │ │ ├── devcontainer-info │ │ └── systemctl │ ├── devcontainer-feature.json │ ├── install.sh │ ├── main.sh │ └── scripts │ │ ├── bash_theme_snippet.sh │ │ ├── devcontainers.zsh-theme │ │ └── rc_snippet.sh ├── conda │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── desktop-lite │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── docker-in-docker │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── docker-outside-of-docker │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── dotnet │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ ├── install.sh │ └── scripts │ │ ├── dotnet-helpers.sh │ │ ├── fetch-latest-dotnet-install.sh │ │ ├── string-helpers.sh │ │ └── vendor │ │ ├── README.md │ │ └── dotnet-install.sh ├── git-lfs │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── git │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── github-cli │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── go │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── hugo │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── java │ ├── NOTES.md │ ├── NOTICE.txt │ ├── README.md │ ├── devcontainer-feature.json │ ├── install.sh │ └── wrapper.sh ├── kubectl-helm-minikube │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── nix │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ ├── install.sh │ ├── nix-entrypoint.sh │ ├── post-install-steps.sh │ └── utils.sh ├── node │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── nvidia-cuda │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── oryx │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ ├── install.sh │ └── scripts │ │ └── vendor │ │ ├── README.md │ │ └── dotnet-install.sh ├── php │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── powershell │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── python │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── ruby │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── rust │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh ├── sshd │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh └── terraform │ ├── NOTES.md │ ├── README.md │ ├── devcontainer-feature.json │ └── install.sh └── test ├── _global ├── all_the_clis.sh ├── node_java_rust.sh └── scenarios.json ├── anaconda └── test.sh ├── aws-cli ├── checkBashCompletion.sh ├── less_installed.sh ├── scenarios.json └── test.sh ├── azure-cli ├── install_bicep.sh ├── install_extensions.sh ├── install_extensions_bookworm.sh ├── install_using_python_with_python_3_11_bullseye.sh ├── install_with_python.sh ├── install_with_python_3_12_bookworm.sh ├── scenarios.json └── test.sh ├── common-utils ├── Azure-linux-CU.sh ├── alma-8-minimal.sh ├── alma-8.sh ├── alma-9-minimal.sh ├── alma-9.sh ├── alma-minimal-8.sh ├── alma-minimal-9.sh ├── alpine-3-14.sh ├── alpine-3-15.sh ├── alpine-3-18.sh ├── alpine-base-zsh-default.sh ├── alpine.sh ├── already-run.sh ├── alternate-values.sh ├── bionic.sh ├── bookworm.sh ├── bullseye.sh ├── buster.sh ├── centos-7.sh ├── config-subdirectory.sh ├── configure_zsh_as_default_shell.sh ├── configure_zsh_no_template_first_step.sh ├── configure_zsh_no_template_second_step.sh ├── devcontainer-custom-home.sh ├── devcontainer-custom-home │ └── Dockerfile ├── devcontainer-custom-user-default-home.sh ├── devcontainer-info.sh ├── devcontainer-info │ ├── Dockerfile │ └── meta.env ├── devcontainer-ruby-zshrc.sh ├── devcontainer-ruby-zshrc │ └── Dockerfile ├── fedora.sh ├── focal.sh ├── jammy.sh ├── mariner.sh ├── no-terminal-title-by-default.sh ├── rocky-8-minimal.sh ├── rocky-8.sh ├── rocky-9-minimal.sh ├── rocky-9.sh ├── scenarios.json ├── terminal-title-on-xterm.sh ├── test.sh ├── username-default.sh └── username-detected.sh ├── conda ├── install_conda.sh ├── scenarios.json └── test.sh ├── desktop-lite ├── scenarios.json ├── test.sh ├── test_vnc_resolution_as_container_env_var.sh ├── test_vnc_resolution_as_remote_env_var.sh └── test_xtigervnc_novnc_started.sh ├── docker-in-docker ├── Dockerfile ├── azureDnsAutoDetectionDisabled.sh ├── azureDnsAutoDetectionEnabled.sh ├── dockerDefaultAddressPool.sh ├── dockerIp6tablesDisabledTest.sh ├── docker_build.sh ├── docker_build_2.sh ├── docker_build_fallback_buildx.sh ├── docker_build_fallback_compose.sh ├── docker_build_no_compose.sh ├── docker_build_older.sh ├── docker_buildx.sh ├── docker_compose_v1.sh ├── docker_compose_v2.sh ├── docker_python_bookworm.sh ├── docker_specific_moby_buildx.sh ├── docker_with_on_create_command.sh ├── pin_docker-ce_version_moby_false.sh ├── scenarios.json └── test.sh ├── docker-outside-of-docker ├── Dockerfile ├── docker_build.sh ├── docker_build_compose_fallback.sh ├── docker_build_moby.sh ├── docker_build_no_buildx.sh ├── docker_build_no_buildx_moby.sh ├── docker_build_no_compose.sh ├── docker_dash_compose_v1.sh ├── docker_dash_compose_v1_moby.sh ├── docker_dash_compose_v2.sh ├── docker_dash_compose_v2_moby.sh ├── docker_init.sh ├── docker_init_debian.sh ├── docker_init_moby.sh ├── docker_init_ubuntu_22.sh ├── docker_install_compose_switch.sh ├── docker_not_install_compose_switch.sh ├── docker_python_bookworm.sh ├── docker_specific_moby_buildx.sh ├── scenarios.json └── test.sh ├── dotnet ├── dotnet_env.sh ├── dotnet_helpers.sh ├── install_aspnetcore_runtime_only.sh ├── install_dotnet_exact_version.sh ├── install_dotnet_global_tool.sh ├── install_dotnet_latest_when_version_is_empty.sh ├── install_dotnet_lts.sh ├── install_dotnet_multiple_versions.sh ├── install_dotnet_runtime_only.sh ├── install_dotnet_specific_release.sh ├── install_dotnet_specific_release_and_feature_band.sh ├── install_dotnet_workloads.sh ├── projects │ ├── .gitignore │ ├── multitargeting │ │ ├── Class1.cs │ │ └── example_classlib.csproj │ ├── net5.0 │ │ ├── Program.cs │ │ └── example_project.csproj │ ├── net6.0 │ │ ├── Program.cs │ │ └── example_project.csproj │ ├── net7.0 │ │ ├── Program.cs │ │ └── example_project.csproj │ ├── net8.0 │ │ ├── Program.cs │ │ └── example_project.csproj │ ├── net9.0 │ │ ├── Program.cs │ │ └── example_project.csproj │ └── netcoreapp3.1 │ │ ├── Program.cs │ │ └── example_project.csproj ├── scenarios.json └── test.sh ├── git-lfs ├── autoPullDisabled.sh ├── autoPullEnabled.sh ├── scenarios.json ├── test.sh └── use_github.sh ├── git ├── install_git_from_ppa_bionic.sh ├── install_git_from_src.sh ├── install_git_from_src_alma-8.sh ├── install_git_from_src_alma-9.sh ├── install_git_from_src_alpine.sh ├── install_git_from_src_bionic.sh ├── install_git_from_src_bullseye.sh ├── install_git_from_src_buster.sh ├── install_git_from_src_centos-7.sh ├── install_git_from_src_fedora.sh ├── install_git_from_src_jammy.sh ├── install_git_from_src_mariner.sh ├── install_git_from_src_rocky-8.sh ├── install_git_from_src_rocky-9.sh ├── install_git_from_system_alma-8.sh ├── install_git_from_system_alma-9.sh ├── install_git_from_system_alpine.sh ├── install_git_from_system_centos-7.sh ├── install_git_from_system_fedora.sh ├── install_git_from_system_mariner.sh ├── install_git_from_system_rocky-8.sh ├── install_git_from_system_rocky-9.sh ├── scenarios.json └── test.sh ├── github-cli ├── install_git_cli_from_release.sh ├── scenarios.json └── test.sh ├── go ├── install_go_alma-8-minimal.sh ├── install_go_alma-8.sh ├── install_go_alma-9-minimal.sh ├── install_go_alma-9.sh ├── install_go_centos-7.sh ├── install_go_fedora.sh ├── install_go_mariner.sh ├── install_go_tool_in_postCreate.sh ├── install_go_tool_in_postCreate_rhel.sh ├── install_go_twice.sh ├── scenarios.json └── test.sh ├── hugo ├── install_hugo_extended.sh ├── scenarios.json └── test.sh ├── java ├── alma-8-minimal.sh ├── alma-8.sh ├── alma-9-minimal.sh ├── alma-9.sh ├── centos-7.sh ├── fedora.sh ├── install_additional_java.sh ├── install_additional_java_rhel_family.sh ├── install_ant_and_gradle_and_maven_and_groovy.sh ├── install_ant_and_gradle_and_maven_and_groovy_for_user.sh ├── install_ant_and_gradle_and_maven_and_groovy_for_user_rhel_family.sh ├── install_ant_and_gradle_and_maven_and_groovy_rhel_family.sh ├── install_ant_and_gradle_and_maven_and_groovy_with_specific_version.sh ├── install_ant_and_gradle_and_maven_and_groovy_with_specific_version_rhel_family.sh ├── install_from_non_default_distro.sh ├── install_from_non_default_distro_rhel_family.sh ├── install_latest_version.sh ├── install_lts_version.sh ├── install_non_conventional_version.sh ├── install_non_conventional_version_rhel_family.sh ├── mariner.sh ├── rocky-8-minimal.sh ├── rocky-8.sh ├── rocky-9-minimal.sh ├── rocky-9.sh ├── scenarios.json └── test.sh ├── kubectl-helm-minikube ├── checkBashCompletion.sh ├── install_kubectl_with_version.sh ├── install_kubectl_without_version.sh ├── install_only_helm_fallback.sh ├── install_only_kubectl.sh ├── scenarios.json └── test.sh ├── nix ├── extra-config.sh ├── flake.sh ├── multi-user-install.sh ├── os-alpine.sh ├── os-debian.sh ├── os-fedora.sh ├── os-rockylinux.sh ├── os-ubuntu.sh ├── packages-use-attr-path.sh ├── packages.sh ├── scenarios.json ├── single-user-install.sh ├── test.sh └── version.sh ├── node ├── alma-8-minimal.sh ├── alma-8.sh ├── alma-9-minimal.sh ├── alma-9.sh ├── centos-7.sh ├── debian_yarn_from_corepack.sh ├── fedora.sh ├── install_additional_node.sh ├── install_additional_node_on_rhel_family.sh ├── install_node_16_on_bionic.sh ├── install_node_on_universal_image.sh ├── install_nvm_0.39.sh ├── install_nvm_0.39_on_rhel_family.sh ├── mariner.sh ├── non_root_user.sh ├── nvm_test_fallback.sh ├── rocky-8-minimal.sh ├── rocky-8.sh ├── rocky-9-minimal.sh ├── rocky-9.sh ├── scenarios.json ├── test.sh ├── version_none.sh ├── version_none_on_rhel_family.sh ├── zsh_default.sh └── zsh_default_on_rhel_family.sh ├── nvidia-cuda ├── install_all_options.sh ├── install_cuda_12_3_version.sh ├── install_cuda_12_4_version.sh ├── install_cuda_12_5_version.sh ├── install_cudnn_nvxt_version.sh ├── scenarios.json └── test.sh ├── oryx ├── install_dotnet_and_oryx.sh ├── install_older_dotnet_and_oryx.sh ├── install_prev_dotnet_and_oryx.sh ├── sample-python │ ├── requirements.txt │ └── src │ │ └── solve.py ├── scenarios.json ├── test.sh └── test_python_project.sh ├── php ├── install_additional_php.sh ├── install_only_composer.sh ├── install_php_8.sh ├── install_php_8_2.sh ├── scenarios.json ├── test.sh └── test_php_fallback.sh ├── powershell ├── install_modules.sh ├── install_modules_version.sh ├── install_powershell_fallback_test.sh ├── powershell_alma_linux.sh ├── scenarios.json ├── test.sh └── validate_powershell_installation.sh ├── python ├── alma-8-minimal.sh ├── alma-8.sh ├── alma-9-minimal.sh ├── alma-9.sh ├── alternatives_switchable_versions.sh ├── centos-7.sh ├── fedora.sh ├── install_additional_jupyterlab.sh ├── install_additional_jupyterlab_rhel_family.sh ├── install_additional_python.sh ├── install_additional_python_rhel_family.sh ├── install_alternate_tools.sh ├── install_alternate_tools_rhel_family.sh ├── install_cpython_fallback_prev_version_test.sh ├── install_jupyterlab.sh ├── install_jupyterlab_debian.sh ├── install_jupyterlab_existing_sudoers_file.sh ├── install_jupyterlab_from_python_image.sh ├── install_jupyterlab_rhel_family.sh ├── install_jupyterlab_ubuntu.sh ├── install_os_provided_python_deb.sh ├── install_os_provided_python_mariner.sh ├── install_os_provided_python_rhel_family.sh ├── install_python310_setuptools_vulnerability.sh ├── install_python310_skipVulnerabilityPatching_true.sh ├── install_python311_setuptools_vulnerability.sh ├── install_python_3_12.sh ├── install_python_shared_lib_deb.sh ├── install_python_shared_lib_rhel_family.sh ├── install_via_oryx.sh ├── scenarios.json ├── test.sh └── update_alternatives_switchable_versions.sh ├── ruby ├── install_additional_ruby.sh ├── ruby_debian.sh ├── ruby_fallback_test.sh ├── scenarios.json └── test.sh ├── rust ├── rust_at_pinned_version.sh ├── rust_with_target.sh ├── scenarios.json └── test.sh ├── sshd └── test.sh └── terraform ├── custom_download_server.sh ├── custom_download_server_with_sentinel.sh ├── install_sentinel.sh ├── install_terraform_docs.sh ├── install_tfsec.sh ├── older_tflint.sh ├── scenarios.json ├── terraform_docs_fallback_test.sh ├── terraform_fallback_test.sh ├── terragrunt_fallback_test.sh ├── test.sh ├── tflint_fallback_test.sh └── tfsec_fallback_test.sh /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18", 3 | "features": { 4 | "ghcr.io/devcontainers/features/docker-in-docker:2": {} 5 | }, 6 | "postCreateCommand": "npm install -g @devcontainers/cli", 7 | "hostRequirements": { 8 | "cpus": 4 9 | }, 10 | "customizations": { 11 | "vscode": { 12 | "extensions": [ 13 | "mads-hartmann.bash-ide-vscode" 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/linter-automated.yaml: -------------------------------------------------------------------------------- 1 | name: "CI - Shell Script Linter" 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | 8 | jobs: 9 | shellchecker: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | 14 | - name: Shell Linter 15 | uses: azohra/shell-linter@v0.6.0 16 | with: 17 | path: "src/**/*.sh" 18 | severity: "error" # [style, info, warning, error] 19 | env: 20 | SHELLCHECK_OPTS: -e SC2072 # Acceptable use of decimal comparison -------------------------------------------------------------------------------- /.github/workflows/linter-manual.yaml: -------------------------------------------------------------------------------- 1 | name: "Manual - Shell Script Linter" 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | path: 6 | description: "Path to the shell scripts to lint" 7 | required: true 8 | default: "src/**/*.sh" 9 | severity: 10 | description: "Minimum Severity (style, info, warning, error)" 11 | required: true 12 | default: "style" 13 | 14 | jobs: 15 | shellchecker: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - name: Shell Linter 21 | uses: azohra/shell-linter@v0.6.0 22 | with: 23 | path: ${{ github.event.inputs.path }} 24 | severity: ${{ github.event.inputs.severity }} 25 | env: 26 | SHELLCHECK_OPTS: -e SC2072 # Acceptable use of decimal comparison -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: "Release dev container features" 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | deploy: 10 | if: ${{ github.ref == 'refs/heads/main' }} 11 | runs-on: ubuntu-latest 12 | permissions: 13 | packages: write 14 | contents: write 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - name: "Publish" 19 | uses: devcontainers/action@v1 20 | with: 21 | publish-features: "true" 22 | base-path-to-features: "./src" 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | -------------------------------------------------------------------------------- /.github/workflows/test-manual.yaml: -------------------------------------------------------------------------------- 1 | name: "Manual - Test Features" 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | features: 6 | description: "List of features to execute tests against" 7 | required: true 8 | default: "go dotnet" 9 | baseImage: 10 | description: "Base image" 11 | required: true 12 | default: "ubuntu:focal" 13 | logLevel: 14 | description: "Log Level (info/debug/trace)" 15 | required: true 16 | default: "info" 17 | 18 | jobs: 19 | test: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v4 23 | 24 | - name: "Install latest devcontainer CLI" 25 | run: npm install -g @devcontainers/cli 26 | 27 | - name: "Testing '${{ github.event.inputs.features }}' against '${{ github.event.inputs.baseImage }}'" 28 | run: devcontainer features test --features ${{ github.event.inputs.features }} --base-image ${{ github.event.inputs.baseImage }} --log-level ${{ github.event.inputs.logLevel }} . 29 | -------------------------------------------------------------------------------- /.github/workflows/validate-metadata-files.yml: -------------------------------------------------------------------------------- 1 | name: "Validate devcontainer-feature.json files" 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | 6 | jobs: 7 | validate: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v4 11 | 12 | - name: "Validate devcontainer-feature.json files" 13 | uses: devcontainers/action@v1 14 | with: 15 | validate-only: "true" 16 | base-path-to-features: "./src" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | workspace.code-workspace -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @devcontainers/maintainers 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/aws-cli/NOTES.md: -------------------------------------------------------------------------------- 1 | Available versions of the AWS CLI can be found here: https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst. 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/aws-cli/README.md: -------------------------------------------------------------------------------- 1 | 2 | # AWS CLI (aws-cli) 3 | 4 | Installs the AWS CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg. 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/aws-cli:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter an AWS CLI version. | string | latest | 19 | 20 | ## Customizations 21 | 22 | ### VS Code Extensions 23 | 24 | - `AmazonWebServices.aws-toolkit-vscode` 25 | 26 | Available versions of the AWS CLI can be found here: https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst. 27 | 28 | ## OS Support 29 | 30 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 31 | 32 | `bash` is required to execute the `install.sh` script. 33 | 34 | 35 | --- 36 | 37 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/aws-cli/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 38 | -------------------------------------------------------------------------------- /src/aws-cli/scripts/fetch-latest-completer-scripts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------------------------------------------------------------------- 3 | # Copyright (c) Microsoft Corporation. All rights reserved. 4 | # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. 5 | #------------------------------------------------------------------------------------------------------------- 6 | # 7 | # Docs: https://github.com/devcontainers/features/tree/main/src/aws-cli 8 | # Maintainer: The Dev Container spec maintainers 9 | # 10 | # Run this script to replace aws_bash_completer and aws_zsh_completer.sh with the latest and greatest available version 11 | # 12 | COMPLETER_SCRIPTS=$(dirname "${BASH_SOURCE[0]}") 13 | BASH_COMPLETER_SCRIPT="$COMPLETER_SCRIPTS/vendor/aws_bash_completer" 14 | ZSH_COMPLETER_SCRIPT="$COMPLETER_SCRIPTS/vendor/aws_zsh_completer.sh" 15 | 16 | wget https://raw.githubusercontent.com/aws/aws-cli/v2/bin/aws_bash_completer -O "$BASH_COMPLETER_SCRIPT" 17 | chmod +x "$BASH_COMPLETER_SCRIPT" 18 | 19 | wget https://raw.githubusercontent.com/aws/aws-cli/v2/bin/aws_zsh_completer.sh -O "$ZSH_COMPLETER_SCRIPT" 20 | chmod +x "$ZSH_COMPLETER_SCRIPT" 21 | -------------------------------------------------------------------------------- /src/aws-cli/scripts/vendor/README.md: -------------------------------------------------------------------------------- 1 | ### **IMPORTANT NOTE** 2 | 3 | Scripts in this directory are sourced externally and not maintained by the Dev Container spec maintainers. Do not make changes directly as they might be overwritten at any moment. 4 | 5 | ## aws_bash_completer 6 | 7 | `aws_bash_completer` is a copy of . 8 | 9 | ## aws_zsh_completer.sh 10 | 11 | `aws_zsh_completer.sh` is a copy of . 12 | 13 | -------------------------------------------------------------------------------- /src/aws-cli/scripts/vendor/aws_bash_completer: -------------------------------------------------------------------------------- 1 | # Typically that would be added under one of the following paths: 2 | # - /etc/bash_completion.d 3 | # - /usr/local/etc/bash_completion.d 4 | # - /usr/share/bash-completion/completions 5 | 6 | complete -C aws_completer aws 7 | -------------------------------------------------------------------------------- /src/azure-cli/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/common-utils/bin/code: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | get_in_path_except_current() { 4 | which -a "$1" | grep -A1 "$0" | grep -v "$0" 5 | } 6 | 7 | code="$(get_in_path_except_current code)" 8 | 9 | if [ -n "$code" ]; then 10 | exec "$code" "$@" 11 | elif [ "$(command -v code-insiders)" ]; then 12 | exec code-insiders "$@" 13 | else 14 | echo "code or code-insiders is not installed" >&2 15 | exit 127 16 | fi 17 | -------------------------------------------------------------------------------- /src/common-utils/bin/systemctl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | if [ -d "/run/systemd/system" ]; then 4 | exec /bin/systemctl "$@" 5 | else 6 | echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services instead. e.g.: \n\nservice --status-all' 7 | fi 8 | -------------------------------------------------------------------------------- /src/docker-in-docker/NOTES.md: -------------------------------------------------------------------------------- 1 | ## Limitations 2 | 3 | This docker-in-docker Dev Container Feature is roughly based on the [official docker-in-docker wrapper script](https://github.com/moby/moby/blob/master/hack/dind) that is part of the [Moby project](https://mobyproject.org/). With this in mind: 4 | * As the name implies, the Feature is expected to work when the host is running Docker (or the OSS Moby container engine it is built on). It may be possible to get running in other container engines, but it has not been tested with them. 5 | * The host and the container must be running on the same chip architecture. You will not be able to use it with an emulated x86 image with Docker Desktop on an Apple Silicon Mac, like in this example: 6 | ``` 7 | FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/typescript-node:16 8 | ``` 9 | See [Issue #219](https://github.com/devcontainers/features/issues/219) for more details. 10 | 11 | 12 | ## OS Support 13 | 14 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 15 | 16 | `bash` is required to execute the `install.sh` script. 17 | -------------------------------------------------------------------------------- /src/dotnet/scripts/fetch-latest-dotnet-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------------------------------------------------------------------- 3 | # Copyright (c) Microsoft Corporation. All rights reserved. 4 | # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. 5 | #------------------------------------------------------------------------------------------------------------- 6 | # 7 | # Docs: https://github.com/devcontainers/features/tree/main/src/dotnet 8 | # Maintainer: The Dev Container spec maintainers 9 | # 10 | # Run this script to replace dotnet-install.sh with the latest and greatest available version 11 | # 12 | DOTNET_SCRIPTS=$(dirname "${BASH_SOURCE[0]}") 13 | DOTNET_INSTALL_SCRIPT="$DOTNET_SCRIPTS/vendor/dotnet-install.sh" 14 | 15 | wget https://dot.net/v1/dotnet-install.sh -O "$DOTNET_INSTALL_SCRIPT" 16 | chmod +x "$DOTNET_INSTALL_SCRIPT" 17 | -------------------------------------------------------------------------------- /src/git-lfs/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/git/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Alpine, Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apk`, `apt`, `yum`, `dnf`, or `microdnf` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/git/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Git (from source) (git) 3 | 4 | Install an up-to-date version of Git, built from source as needed. Useful for when you want the latest and greatest features. Auto-detects latest stable version and installs needed dependencies. 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/git:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter a Git version. | string | os-provided | 19 | | ppa | Install from PPA if available (only supported for Ubuntu distributions) | boolean | true | 20 | 21 | 22 | 23 | ## OS Support 24 | 25 | This Feature should work on recent versions of Alpine, Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apk`, `apt`, `yum`, `dnf`, or `microdnf` package manager installed. 26 | 27 | `bash` is required to execute the `install.sh` script. 28 | 29 | 30 | --- 31 | 32 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/git/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 33 | -------------------------------------------------------------------------------- /src/github-cli/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/github-cli/README.md: -------------------------------------------------------------------------------- 1 | 2 | # GitHub CLI (github-cli) 3 | 4 | Installs the GitHub CLI. Auto-detects latest version and installs needed dependencies. 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/github-cli:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select version of the GitHub CLI, if not latest. | string | latest | 19 | | installDirectlyFromGitHubRelease | - | boolean | true | 20 | 21 | 22 | 23 | ## OS Support 24 | 25 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 26 | 27 | `bash` is required to execute the `install.sh` script. 28 | 29 | 30 | --- 31 | 32 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/github-cli/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 33 | -------------------------------------------------------------------------------- /src/go/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the apt, yum, dnf, or microdnf package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/go/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Go (go) 3 | 4 | Installs Go and common Go utilities. Auto-detects latest version and installs needed dependencies. 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/go:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter a Go version to install | string | latest | 19 | | golangciLintVersion | Version of golangci-lint to install | string | latest | 20 | 21 | ## Customizations 22 | 23 | ### VS Code Extensions 24 | 25 | - `golang.Go` 26 | 27 | 28 | 29 | ## OS Support 30 | 31 | This Feature should work on recent versions of Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the apt, yum, dnf, or microdnf package manager installed. 32 | 33 | `bash` is required to execute the `install.sh` script. 34 | 35 | 36 | --- 37 | 38 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/go/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 39 | -------------------------------------------------------------------------------- /src/hugo/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/hugo/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Hugo (hugo) 3 | 4 | 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/hugo:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter a version. | string | latest | 19 | | extended | Install Hugo extended for SASS/SCSS changes | boolean | false | 20 | 21 | 22 | 23 | ## OS Support 24 | 25 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 26 | 27 | `bash` is required to execute the `install.sh` script. 28 | 29 | 30 | --- 31 | 32 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/hugo/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 33 | -------------------------------------------------------------------------------- /src/hugo/devcontainer-feature.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "hugo", 3 | "version": "1.1.3", 4 | "name": "Hugo", 5 | "documentationURL": "https://github.com/devcontainers/features/tree/main/src/hugo", 6 | "options": { 7 | "version": { 8 | "type": "string", 9 | "proposals": [ 10 | "latest" 11 | ], 12 | "default": "latest", 13 | "description": "Select or enter a version." 14 | }, 15 | "extended": { 16 | "type": "boolean", 17 | "default": false, 18 | "description": "Install Hugo extended for SASS/SCSS changes" 19 | } 20 | }, 21 | "containerEnv": { 22 | "HUGO_DIR": "/usr/local/hugo", 23 | "PATH": "/usr/local/hugo/bin:${PATH}" 24 | }, 25 | "customizations": { 26 | "vscode": { 27 | "settings": { 28 | "github.copilot.chat.codeGeneration.instructions": [ 29 | { 30 | "text": "This dev container includes Hugo, a popular open-source static site generator written in Go, pre-installed and available on the `PATH`." 31 | } 32 | ] 33 | } 34 | } 35 | }, 36 | "installsAfter": [ 37 | "ghcr.io/devcontainers/features/common-utils" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /src/java/NOTES.md: -------------------------------------------------------------------------------- 1 | ## License 2 | 3 | For the Java Feature from this repository, see [NOTICE.txt](https://github.com/devcontainers/features/tree/main/src/java/NOTICE.txt) for licensing information on JDK distributions. 4 | 5 | 6 | ## OS Support 7 | 8 | Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed. 9 | 10 | `bash` is required to execute the `install.sh` script. 11 | -------------------------------------------------------------------------------- /src/kubectl-helm-minikube/NOTES.md: -------------------------------------------------------------------------------- 1 | ## Ingress and port forwarding 2 | 3 | When configuring [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) for your Kubernetes cluster, note that by default Kubernetes will bind to a specific interface's IP rather than localhost or all interfaces. This is why you need to use the Kubernetes Node's IP when connecting - even if there's only one Node as in the case of Minikube. Port forwarding in Remote - Containers will allow you to specify `:` in either the `forwardPorts` property or through the port forwarding UI in VS Code. 4 | 5 | However, GitHub Codespaces does not yet support this capability, so you'll need to use `kubectl` to forward the port to localhost. This adds minimal overhead since everything is on the same machine. E.g.: 6 | 7 | ```bash 8 | minikube start 9 | minikube addons enable ingress 10 | # Run this to forward to localhost in the background 11 | nohup kubectl port-forward --pod-running-timeout=24h -n ingress-nginx service/ingress-nginx-controller :80 & 12 | ``` 13 | 14 | 15 | ## OS Support 16 | 17 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 18 | 19 | `bash` is required to execute the `install.sh` script. 20 | -------------------------------------------------------------------------------- /src/nix/nix-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Attempt to start daemon 3 | set +e 4 | if ! pidof nix-daemon > /dev/null 2>&1; then 5 | start_ok=false 6 | if [ "$(id -u)" = "0" ]; then 7 | ( . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh; /nix/var/nix/profiles/default/bin/nix-daemon > /tmp/nix-daemon.log 2>&1 ) & 8 | if [ "$?" = "0" ]; then 9 | start_ok=true 10 | fi 11 | elif type sudo > /dev/null 2>&1; then 12 | sudo -n sh -c '. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh; /nix/var/nix/profiles/default/bin/nix-daemon > /tmp/nix-daemon.log 2>&1' & 13 | if [ "$?" = "0" ]; then 14 | start_ok=true 15 | fi 16 | fi 17 | if [ "${start_ok}" = "false" ]; then 18 | echo -e 'Failed to start nix-daemon as root. Set multiUser to false in your feature configuration if you would\nprefer to run the container as a non-root. You may also start the daemon manually if you have sudo\ninstalled and configured for your user by running "sudo -c nix-daemon &"' 19 | fi 20 | fi 21 | exec "$@" 22 | -------------------------------------------------------------------------------- /src/nix/post-install-steps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | echo "(*) Executing post-installation steps..." 4 | 5 | # if not starts with "nixpkgs." add it as prefix to package name 6 | add_nixpkgs_prefix() { 7 | local packages=$1 8 | local -a addr 9 | IFS=' ' read -ra addr <<<"$packages" 10 | for i in "${!addr[@]}"; do 11 | if [[ ${addr[i]} != nixpkgs.* ]]; then 12 | addr[i]="nixpkgs.${addr[i]}" 13 | fi 14 | done 15 | IFS=' ' echo "${addr[*]}" 16 | } 17 | 18 | # Install list of packages in profile if specified. 19 | if [ ! -z "${PACKAGES}" ] && [ "${PACKAGES}" != "none" ]; then 20 | if [ "${USEATTRIBUTEPATH}" = "true" ]; then 21 | PACKAGES=$(add_nixpkgs_prefix "$PACKAGES") 22 | echo "Installing packages \"${PACKAGES}\" in profile..." 23 | nix-env -iA ${PACKAGES} 24 | else 25 | echo "Installing packages \"${PACKAGES}\" in profile..." 26 | nix-env --install ${PACKAGES} 27 | fi 28 | fi 29 | 30 | # Install Nix flake in profile if specified 31 | if [ ! -z "${FLAKEURI}" ] && [ "${FLAKEURI}" != "none" ]; then 32 | echo "Installing flake ${FLAKEURI} in profile..." 33 | nix profile install "${FLAKEURI}" 34 | fi 35 | 36 | nix-collect-garbage --delete-old 37 | nix-store --optimise 38 | -------------------------------------------------------------------------------- /src/node/NOTES.md: -------------------------------------------------------------------------------- 1 | ## Using nvm from postCreateCommand or another lifecycle command 2 | 3 | Certain operations like `postCreateCommand` run non-interactive, non-login shells. Unfortunately, `nvm` is really particular that it needs to be "sourced" before it is used, which can only happen automatically with interactive and/or login shells. Fortunately, this is easy to work around: 4 | 5 | Just can source the `nvm` startup script before using it: 6 | 7 | ```json 8 | "postCreateCommand": ". ${NVM_DIR}/nvm.sh && nvm install --lts" 9 | ``` 10 | 11 | Note that typically the default shell in these cases is `sh` not `bash`, so use `. ${NVM_DIR}/nvm.sh` instead of `source ${NVM_DIR}/nvm.sh`. 12 | 13 | Alternatively, you can start up an interactive shell which will in turn source `nvm`: 14 | 15 | ```json 16 | "postCreateCommand": "bash -i -c 'nvm install --lts'" 17 | ``` 18 | 19 | 20 | 21 | ## OS Support 22 | 23 | Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and Rocky Linux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed. 24 | 25 | **Note**: RedHat 7 Family (RedHat, CentOS, etc.) must use Node versions less than 18 due to its system libraries and long-term support (LTS) policies. 26 | 27 | `bash` is required to execute the `install.sh` script. 28 | -------------------------------------------------------------------------------- /src/oryx/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | See [supportedPlatformVersions.md](https://github.com/microsoft/Oryx/blob/main/doc/supportedPlatformVersions.md) on the Oryx repository for supported platforms. Notably, `oryx` does not support Debian "jammy". 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/oryx/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Oryx (oryx) 3 | 4 | Installs the oryx CLI 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/oryx:1": {} 11 | } 12 | ``` 13 | 14 | 15 | 16 | 17 | 18 | ## OS Support 19 | 20 | See [supportedPlatformVersions.md](https://github.com/microsoft/Oryx/blob/main/doc/supportedPlatformVersions.md) on the Oryx repository for supported platforms. Notably, `oryx` does not support Debian "jammy". 21 | 22 | `bash` is required to execute the `install.sh` script. 23 | 24 | 25 | --- 26 | 27 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/oryx/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 28 | -------------------------------------------------------------------------------- /src/oryx/devcontainer-feature.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "oryx", 3 | "version": "1.4.1", 4 | "name": "Oryx", 5 | "description": "Installs the oryx CLI", 6 | "documentationURL": "https://github.com/devcontainers/features/tree/main/src/oryx", 7 | "containerEnv": { 8 | "ORYX_SDK_STORAGE_BASE_URL": "https://oryx-cdn.microsoft.io", 9 | "ENABLE_DYNAMIC_INSTALL": "true", 10 | "DYNAMIC_INSTALL_ROOT_DIR": "/opt", 11 | "ORYX_PREFER_USER_INSTALLED_SDKS": "true", 12 | "ORYX_DIR": "/usr/local/oryx", 13 | "DEBIAN_FLAVOR": "focal-scm", 14 | "PATH": "/usr/local/oryx:${PATH}" 15 | }, 16 | "customizations": { 17 | "vscode": { 18 | "settings": { 19 | "github.copilot.chat.codeGeneration.instructions": [ 20 | { 21 | "text": "This dev container includes the oryx CLI pre-installed and available on the `PATH`." 22 | } 23 | ] 24 | } 25 | } 26 | }, 27 | "installsAfter": [ 28 | "ghcr.io/devcontainers/features/common-utils", 29 | "ghcr.io/devcontainers/features/dotnet" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /src/php/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/php/README.md: -------------------------------------------------------------------------------- 1 | 2 | # PHP (php) 3 | 4 | 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/php:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter a PHP version | string | latest | 19 | | installComposer | Install PHP Composer? | boolean | true | 20 | 21 | ## Customizations 22 | 23 | ### VS Code Extensions 24 | 25 | - `xdebug.php-debug` 26 | - `bmewburn.vscode-intelephense-client` 27 | - `xdebug.php-pack` 28 | - `devsense.phptools-vscode` 29 | 30 | 31 | 32 | ## OS Support 33 | 34 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 35 | 36 | `bash` is required to execute the `install.sh` script. 37 | 38 | 39 | --- 40 | 41 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/php/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 42 | -------------------------------------------------------------------------------- /src/powershell/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/python/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the apt, yum, dnf, or microdnf package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/ruby/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/ruby/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Ruby (via rvm) (ruby) 3 | 4 | Installs Ruby, rvm, rbenv, common Ruby utilities, and needed dependencies. 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/ruby:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter a Ruby version to install | string | latest | 19 | 20 | ## Customizations 21 | 22 | ### VS Code Extensions 23 | 24 | - `shopify.ruby-lsp` 25 | 26 | 27 | 28 | ## OS Support 29 | 30 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 31 | 32 | `bash` is required to execute the `install.sh` script. 33 | 34 | 35 | --- 36 | 37 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/ruby/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 38 | -------------------------------------------------------------------------------- /src/rust/NOTES.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## OS Support 4 | 5 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 6 | 7 | `bash` is required to execute the `install.sh` script. 8 | -------------------------------------------------------------------------------- /src/rust/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Rust (rust) 3 | 4 | Installs Rust, common Rust utilities, and their required dependencies 5 | 6 | ## Example Usage 7 | 8 | ```json 9 | "features": { 10 | "ghcr.io/devcontainers/features/rust:1": {} 11 | } 12 | ``` 13 | 14 | ## Options 15 | 16 | | Options Id | Description | Type | Default Value | 17 | |-----|-----|-----|-----| 18 | | version | Select or enter a version of Rust to install. | string | latest | 19 | | profile | Select a rustup install profile. | string | minimal | 20 | | targets | Optional comma separated list of additional Rust targets to install. | string | - | 21 | 22 | ## Customizations 23 | 24 | ### VS Code Extensions 25 | 26 | - `vadimcn.vscode-lldb` 27 | - `rust-lang.rust-analyzer` 28 | - `tamasfe.even-better-toml` 29 | 30 | 31 | 32 | ## OS Support 33 | 34 | This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. 35 | 36 | `bash` is required to execute the `install.sh` script. 37 | 38 | 39 | --- 40 | 41 | _Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/rust/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ 42 | -------------------------------------------------------------------------------- /test/_global/all_the_clis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "check for aws" aws --version 10 | check "check for gh" gh --version 11 | check "check for azure" az --version 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/_global/node_java_rust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "check for node" node --version 10 | check "check for java" java --version 11 | check "check for rust" rustc --version 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/_global/scenarios.json: -------------------------------------------------------------------------------- 1 | { 2 | "all_the_clis": { 3 | "image": "ubuntu:focal", 4 | "features": { 5 | "aws-cli": {}, 6 | "azure-cli": {}, 7 | "github-cli": {} 8 | } 9 | }, 10 | "node_java_rust": { 11 | "image": "ubuntu:focal", 12 | "features": { 13 | "node": {}, 14 | "java": {}, 15 | "rust": {} 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /test/anaconda/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "version" conda --version 10 | check "if conda-notice.txt exists" cat /usr/local/etc/vscode-dev-containers/conda-notice.txt 11 | 12 | # Report result 13 | reportResults -------------------------------------------------------------------------------- /test/aws-cli/checkBashCompletion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | command=$1 4 | expected=$2 5 | 6 | echo -e "Checking completion for command '$command'..." 7 | 8 | # Send command as a character stream, followed by two tab characters, into an interactive bash shell. 9 | # Also note the 'y' which responds to the possible Bash question "Display all xxx possibilities? (y or n)". 10 | # Bash produces the autocompletion output on stderr, so redirect that to stdout. 11 | # The sed bit captures the lines between Header and Footer (used as output delimiters). 12 | # The first grep removes the "Display all" message (that is atomatically answered to "y" by the script). 13 | # The last grep filters the output to lines containing the expected result. 14 | COMPLETE_OUTPUT=$(echo if false\; then "Header"\; $command$'\t'$'\t'y\; "Footer" fi | bash -i 2>&1 | sed -n '/Header/{:a;n;/Footer/q;p;ba}' | grep -v ^'Display all ') 15 | echo -e "\nCompletion output:\n" 16 | echo -e "$COMPLETE_OUTPUT" 17 | echo -e "\n" 18 | 19 | FILTERED_COMPLETE_OUTPUT=$(echo "$COMPLETE_OUTPUT" | grep "$expected") 20 | 21 | if [ -z "$FILTERED_COMPLETE_OUTPUT" ]; then 22 | echo -e "Completion output does not contains '$expected'." 23 | exit 1 24 | else 25 | echo -e "Completion output contains '$expected'." 26 | exit 0 27 | fi 28 | -------------------------------------------------------------------------------- /test/aws-cli/less_installed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | check "less is installed, pagination works !" less --version 9 | check "less binary installation path" which less 10 | check "Testing paginated output with less" ls -R / | less 11 | 12 | # Report result 13 | reportResults -------------------------------------------------------------------------------- /test/aws-cli/scenarios.json: -------------------------------------------------------------------------------- 1 | { 2 | "less_installed": { 3 | "image": "mcr.microsoft.com/devcontainers/base:ubuntu", 4 | "features": { 5 | "aws-cli": {} 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /test/aws-cli/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "version" aws --version 10 | 11 | # By default bash complete is disabled for the root user 12 | # Enable it by replacing current ~/.bashrc with the /etc/skel/.bashrc file 13 | mv ~/.bashrc ~/.bashrc.bak 14 | cp /etc/skel/.bashrc ~/ 15 | 16 | check "aws-bash-completion-contains-version-option" ./checkBashCompletion.sh "aws --" "version" 17 | 18 | # Restore original ~/.bashrc 19 | mv ~/.bashrc.bak ~/.bashrc 20 | 21 | # Report result 22 | reportResults -------------------------------------------------------------------------------- /test/azure-cli/install_bicep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | # Check to make sure the user is vscode 9 | check "user is vscode" whoami | grep vscode 10 | 11 | check "version" az --version 12 | 13 | # Bicep-specific tests 14 | check "bicep" bicep --version 15 | check "az bicep" az bicep version 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/azure-cli/install_extensions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | # Check to make sure the user is vscode 9 | check "user is vscode" whoami | grep vscode 10 | 11 | check "version" az --version 12 | 13 | # Extension-specific tests 14 | check "aks-preview" az extension show --name aks-preview 15 | check "amg" az extension show --name amg 16 | check "containerapp" az extension show --name containerapp 17 | 18 | # Report result 19 | reportResults -------------------------------------------------------------------------------- /test/azure-cli/install_extensions_bookworm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | ./install_extensions.sh -------------------------------------------------------------------------------- /test/azure-cli/install_using_python_with_python_3_11_bullseye.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | # Check to make sure the user is vscode 9 | check "user is vscode" whoami | grep vscode 10 | check "version" az --version 11 | 12 | echo -e "\n\n🔄 Testing 'O.S'" 13 | if cat /etc/os-release | grep -q 'PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"'; then 14 | echo -e "\n\n✅ Passed 'O.S is Linux 11 (bullseye)'!" 15 | else 16 | echo -e "\n\n❌ Failed 'O.S is other than Linux 11 (bullseye)'!" 17 | fi 18 | 19 | 20 | # Report result 21 | reportResults -------------------------------------------------------------------------------- /test/azure-cli/install_with_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | # Check to make sure the user is vscode 9 | check "user is vscode" whoami | grep vscode 10 | check "version" az --version 11 | 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/azure-cli/install_with_python_3_12_bookworm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Import test library for `check` command 6 | source dev-container-features-test-lib 7 | 8 | 9 | echo -e "\n🔄 Testing 'O.S'" 10 | if cat /etc/os-release | grep -q 'PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"'; then 11 | echo -e "\n✅ Passed 'O.S is Linux 12 (bookworm)'!\n" 12 | else 13 | echo -e "\n❌ Failed 'O.S is other than Linux 12 (bookworm)'!\n" 14 | fi 15 | 16 | # Check to make sure the user is vscode 17 | check "user is vscode" whoami | grep vscode 18 | check "version" az --version 19 | 20 | # Report result 21 | reportResults -------------------------------------------------------------------------------- /test/azure-cli/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "version" az --version 10 | 11 | # Report result 12 | reportResults -------------------------------------------------------------------------------- /test/common-utils/Azure-linux-CU.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Load Linux distribution info 9 | . /etc/os-release 10 | 11 | # Check if the current user is root 12 | check "root user" test "$(whoami)" = "root" 13 | 14 | # Check if the Linux distro is Azure Linux 15 | check "azurelinux distro" test "$ID" = "azurelinux" 16 | 17 | # Definition specific tests 18 | check "curl" curl --version 19 | check "jq" jq --version 20 | 21 | # Report result 22 | reportResults 23 | -------------------------------------------------------------------------------- /test/common-utils/alma-8-minimal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el8" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alma-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el8" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alma-9-minimal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el9" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alma-9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el9" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alma-minimal-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el9" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alma-minimal-9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el9" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alpine-3-14.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${ID}" = "alpine" 12 | check "bashrc" ls /etc/bash/bashrc 13 | 14 | # Report result 15 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alpine-3-15.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${ID}" = "alpine" 12 | check "bashrc" ls /etc/bash/bashrc 13 | 14 | # Report result 15 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alpine-3-18.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${ID}" = "alpine" 12 | check "bashrc" ls /etc/bash/bashrc 13 | check "libssl1.1 is installed" grep "libssl1.1" <(apk list --no-cache libssl1.1) 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alpine-base-zsh-default.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "alpine default shell zsh" \ 10 | bash -c "getent passwd $(whoami) | awk -F : '{ print $7 }' | grep '/bin/zsh'" 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/common-utils/alpine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${ID}" = "alpine" 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/common-utils/already-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "non-root user" test "$(whoami)" = "vscode" 10 | check "jq" jq --version 11 | check "curl" curl --version 12 | check "git" git --version 13 | check "zsh" zsh --version 14 | check "ps" ps --version 15 | check "Oh My Zsh! theme" test -e $HOME/.oh-my-zsh/custom/themes 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/common-utils/alternate-values.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "non-root user" id alternate 10 | check "running as root" test "$(whoami)" = "root" 11 | check "jq" jq --version 12 | check "curl" curl --version 13 | check "git" git --version 14 | check "ps" ps --version 15 | check "no zsh" bash -c '! zsh --version' 16 | check "No Oh My Zsh!" test ! -e /home/alternate/.oh-my-zsh/custom/themes/devcontainers.zsh-theme 17 | 18 | # Report result 19 | reportResults -------------------------------------------------------------------------------- /test/common-utils/bionic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${VERSION_CODENAME}" = "bionic" 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/common-utils/bookworm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | FAILED=() 9 | echoStderr() 10 | { 11 | echo "$@" 1>&2 12 | } 13 | 14 | checkOSPackages() { 15 | LABEL=$1 16 | shift 17 | echo -e "\n🧪 Testing $LABEL" 18 | if dpkg-query --show -f='${Package}: ${Version}\n' "$@"; then 19 | echo "✅ Passed!" 20 | return 0 21 | else 22 | echoStderr "❌ $LABEL check failed." 23 | FAILED+=("$LABEL") 24 | return 1 25 | fi 26 | } 27 | 28 | checkCommon() 29 | { 30 | PACKAGE_LIST="manpages-posix \ 31 | manpages-posix-dev" 32 | 33 | checkOSPackages "Installation of manpages-posix and manpages-posix-dev (non-free)" ${PACKAGE_LIST} 34 | } 35 | 36 | # Check for manpages-posix, manpages-posix-dev non-free packages 37 | checkCommon 38 | 39 | # Definition specific tests 40 | . /etc/os-release 41 | check "non-root user" test "$(whoami)" = "devcontainer" 42 | check "distro" test "${VERSION_CODENAME}" = "bookworm" 43 | 44 | # Report result 45 | reportResults -------------------------------------------------------------------------------- /test/common-utils/bullseye.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${VERSION_CODENAME}" = "bullseye" 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/common-utils/buster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${VERSION_CODENAME}" = "buster" 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/common-utils/centos-7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${VERSION_ID}" = "7" 12 | check "jq" jq --version 13 | 14 | # Report result 15 | reportResults -------------------------------------------------------------------------------- /test/common-utils/config-subdirectory.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "owned-config-sub-directory" bash -c "ls -ld ~/.config/subdirectory | awk '{print $3}' | grep 'devcontainer'" 10 | check "owned-config-directory" bash -c "ls -ld ~/.config | awk '{print $3}' | grep 'devcontainer'" 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/common-utils/configure_zsh_as_default_shell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "default-shell-is-zsh" bash -c "getent passwd $(whoami) | awk -F: '{ print $7 }' | grep '/bin/zsh'" 10 | # check it overrides the ~/.zshrc with default dev containers template 11 | check "default-zshrc-is-dev-container-template" bash -c "cat ~/.zshrc | grep ZSH_THEME | grep devcontainers" 12 | check "zsh-path-contains-local-bin" zsh -l -c "echo $PATH | grep '/home/devcontainer/.local/bin'" 13 | 14 | check "Ensure .zprofile is owned by remoteUser" bash -c "stat -c '%U' /home/devcontainer/.zprofile | grep devcontainer" 15 | 16 | # Report result 17 | reportResults 18 | -------------------------------------------------------------------------------- /test/common-utils/configure_zsh_no_template_first_step.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "default-zsh-with-no-zshrc" bash -c "[ ! -e ~/.zshrc ]" 10 | 11 | # Report result 12 | reportResults 13 | -------------------------------------------------------------------------------- /test/common-utils/configure_zsh_no_template_second_step.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | # Definition specific tests 8 | function file_not_overridden() { 9 | cat $1 | grep 'alias fnomockalias=' | grep testingmock 10 | } 11 | check "default-zsh-with-no-zshrc" file_not_overridden /home/devcontainer/.zshrc 12 | 13 | # Report result 14 | reportResults 15 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-custom-home.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "user is customUser" grep customUser <(whoami) 10 | check "home is /customHome" grep "/customHome" <(getent passwd customUser | cut -d: -f6) 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-custom-home/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | 3 | RUN groupadd customUser -g 30000 && \ 4 | useradd customUser -u 30000 -g 30000 --create-home --home-dir /customHome 5 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-custom-user-default-home.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "user is customUser" grep customUser <(whoami) 10 | check "home is /home/customUser" grep "/home/customUser" <(getent passwd customUser | cut -d: -f6) 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | check_info() { 9 | local info=$1 10 | check "devcontainer-info ${info}" sh -c "devcontainer-info | grep test-${info}" 11 | } 12 | 13 | # Definition specific tests 14 | check "user" bash -c "whoami | grep vscode" 15 | check_info "version" 16 | check_info "id" 17 | check_info "variant" 18 | check_info "repository" 19 | check_info "release" 20 | check_info "revision" 21 | check_info "time" 22 | check_info "url" 23 | 24 | # Report result 25 | reportResults 26 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-info/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | 3 | COPY meta.env /usr/local/etc/dev-containers/meta.env 4 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-info/meta.env: -------------------------------------------------------------------------------- 1 | VERSION='test-version' 2 | DEFINITION_ID='test-id' 3 | VARIANT='test-variant' 4 | GIT_REPOSITORY='test-repository' 5 | GIT_REPOSITORY_RELEASE='test-release' 6 | GIT_REPOSITORY_REVISION='test-revision' 7 | BUILD_TIMESTAMP='test-time' 8 | CONTENTS_URL='test-url' 9 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-ruby-zshrc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "configure-zshrc-without-overwrite" bash -c "grep 'rbenv init -' ~/.zshrc" 10 | 11 | # Report result 12 | reportResults 13 | -------------------------------------------------------------------------------- /test/common-utils/devcontainer-ruby-zshrc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/devcontainers/ruby:3.2 2 | 3 | USER vscode 4 | ENV USER=vscode 5 | RUN echo 'eval "$(rbenv init -)"' >> /home/$USER/.zshrc 6 | 7 | -------------------------------------------------------------------------------- /test/common-utils/fedora.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${ID}" = "fedora" 12 | check "jq" jq --version 13 | 14 | # Report result 15 | reportResults -------------------------------------------------------------------------------- /test/common-utils/focal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${VERSION_CODENAME}" = "focal" 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/common-utils/jammy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${VERSION_CODENAME}" = "jammy" 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/common-utils/mariner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${ID}" = "mariner" 12 | check "jq" jq --version 13 | 14 | # Report result 15 | reportResults -------------------------------------------------------------------------------- /test/common-utils/no-terminal-title-by-default.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | 11 | # Make sure bashrc is applied 12 | source /root/.bashrc 13 | 14 | check "check_term_is_not_set" test !"$TERM" 15 | check "check_prompt_command_not_set" test !"$PROMPT_COMMAND" 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/common-utils/rocky-8-minimal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el8" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/rocky-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el8" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/rocky-9-minimal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el9" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/rocky-9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | check "non-root user" test "$(whoami)" = "devcontainer" 11 | check "distro" test "${PLATFORM_ID}" = "platform:el9" 12 | check "curl" curl --version 13 | check "jq" jq --version 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/common-utils/terminal-title-on-xterm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | 11 | # Make sure bashrc is applied 12 | source /root/.bashrc 13 | 14 | check "check_term_is_set" test "$TERM" = "xterm" 15 | check "check_term_is_set" test "$PROMPT_COMMAND" = "precmd" 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/common-utils/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "jq" jq --version 10 | check "curl" curl --version 11 | check "git" git --version 12 | check "zsh" zsh --version 13 | check "ps" ps --version 14 | check "Oh My Zsh! theme" test -e $HOME/.oh-my-zsh/custom/themes/devcontainers.zsh-theme 15 | check "zsh theme symlink" test -e $HOME/.oh-my-zsh/custom/themes/codespaces.zsh-theme 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/common-utils/username-default.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | # .oh-my-zsh folder would only exist if user defaulting worked 11 | check "non-root user" ls /home/vscode/.oh-my-zsh 12 | 13 | 14 | # Report result 15 | reportResults -------------------------------------------------------------------------------- /test/common-utils/username-detected.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | . /etc/os-release 10 | # .oh-my-zsh folder would only exist if user detection worked 11 | check "non-root user" ls /home/node/.oh-my-zsh 12 | 13 | # Report result 14 | reportResults -------------------------------------------------------------------------------- /test/conda/install_conda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | check "conda" conda --version | grep 4.12.0 9 | check "conda-forge" conda config --show channels | grep conda-forge 10 | check "if conda-notice.txt exists" cat /usr/local/etc/vscode-dev-containers/conda-notice.txt 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/conda/scenarios.json: -------------------------------------------------------------------------------- 1 | { 2 | "install_conda": { 3 | "image": "ubuntu:focal", 4 | "features": { 5 | "conda": { 6 | "version": "4.12.0", 7 | "addCondaForge": "true" 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/desktop-lite/scenarios.json: -------------------------------------------------------------------------------- 1 | { 2 | "test_xtigervnc_novnc_started": { 3 | "image": "ubuntu:noble", 4 | "features": { 5 | "desktop-lite": {} 6 | } 7 | }, 8 | "test_vnc_resolution_as_container_env_var": { 9 | "image": "ubuntu:noble", 10 | "features": { 11 | "desktop-lite": {} 12 | } 13 | , 14 | "containerEnv": { 15 | "VNC_RESOLUTION": "1920x1080x32" 16 | }, 17 | "forwardPorts": [ 18 | 5901, 19 | 6080 20 | ] 21 | }, 22 | "test_vnc_resolution_as_remote_env_var": { 23 | "image": "ubuntu:noble", 24 | "features": { 25 | "desktop-lite": {} 26 | }, 27 | "remoteEnv": { 28 | "VNC_RESOLUTION": "1920x1080x32" 29 | }, 30 | "forwardPorts": [ 31 | 5901, 32 | 6080 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /test/desktop-lite/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | echoStderr() 9 | { 10 | echo "$@" 1>&2 11 | } 12 | 13 | checkOSPackage() { 14 | LABEL=$1 15 | PACKAGE_NAME=$2 16 | echo -e "\n🧪 Testing $LABEL" 17 | # Check if the package exists and retrieve its exact version 18 | if [ "$(dpkg-query -W -f='${Status}' "$PACKAGE_NAME" 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then 19 | echo "✅ Package '$PACKAGE_NAME' is installed." 20 | exit 0 21 | else 22 | echo "❌ Package '$PACKAGE_NAME' is not installed." 23 | exit 1 24 | fi 25 | } 26 | 27 | check "desktop-init-exists" bash -c "ls /usr/local/share/desktop-init.sh" 28 | check "log-exists" bash -c "ls /tmp/container-init.log" 29 | check "fluxbox-exists" bash -c "ls -la ~/.fluxbox" 30 | 31 | . /etc/os-release 32 | if [ "${ID}" = "ubuntu" ]; then 33 | if [ "${VERSION_CODENAME}" = "noble" ]; then 34 | checkOSPackage "if libasound2-dev exists !" "libasound2-dev" 35 | else 36 | checkOSPackage "if libasound2 exists !" "libasound2" 37 | fi 38 | else 39 | checkOSPackage "if libasound2 exists !" "libasound2" 40 | fi 41 | 42 | # Report result 43 | reportResults -------------------------------------------------------------------------------- /test/desktop-lite/test_xtigervnc_novnc_started.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Check if xtigervnc & noVnc processes are running after successful installation and initialization 9 | check_process_running() { 10 | port=$1 11 | # Get process id of process running on specific port 12 | PID=$(lsof -i :$port | awk 'NR==2 {print $2}') 13 | if [ -n "$PID" ]; then 14 | CMD=$(ps -p $PID -o cmd --no-headers) 15 | GREEN='\033[0;32m'; NC='\033[0m'; RED='\033[0;31m'; YELLOW='\033[0;33m'; 16 | echo -e "${GREEN}Command running on port $port: ${YELLOW}$CMD${NC}" 17 | else 18 | echo -e "${RED}No process found listening on port $port.${NC}" 19 | fi 20 | } 21 | 22 | check "Whether xtigervnc is Running" check_process_running 5901 23 | sleep 1 24 | check "Whether no_vnc is Running" check_process_running 6080 25 | 26 | check "desktop-init-exists" bash -c "ls /usr/local/share/desktop-init.sh" 27 | check "log-exists" bash -c "ls /tmp/container-init.log" 28 | check "log file contents" bash -c "cat /tmp/container-init.log" 29 | 30 | # Report result 31 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | -------------------------------------------------------------------------------- /test/docker-in-docker/azureDnsAutoDetectionDisabled.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "dns flag should not be present" test ! "$(ps -ax | grep -v grep | grep -E 'dockerd.+\-\-dns')" 10 | 11 | # Report result 12 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/azureDnsAutoDetectionEnabled.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "dns flag should be present" ps -ax | grep -v grep | grep -E "dockerd.+\-\-dns" 10 | 11 | # Report result 12 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/dockerDefaultAddressPool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "default address pool setting set" ps -ax | grep -v grep | grep -E "dockerd.+base=192.168.0.0/16,size=24" 10 | 11 | # Report result 12 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/dockerIp6tablesDisabledTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | ip6tablesCheck() { 9 | if command -v ip6tables > /dev/null 2>&1; then 10 | if ip6tables -L > /dev/null 2>&1; then 11 | echo "✔️ ip6tables is enabled." 12 | else 13 | echo "❌ ip6tables is disabled." 14 | fi 15 | else 16 | echo "❕ip6tables command not found. ❕" 17 | fi 18 | } 19 | 20 | check "ip6tables" ip6tablesCheck 21 | check "ip6tables check" bash -c "docker network inspect bridge" 22 | check "docker-build" docker build ./ 23 | 24 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/docker_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" docker buildx version 10 | check "docker-build" docker build ./ 11 | 12 | check "installs compose-switch" bash -c "[[ -f /usr/local/bin/compose-switch ]]" 13 | check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'" 14 | check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'" 15 | 16 | check "docker-buildx" bash -c "docker buildx version" 17 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 18 | 19 | # Report result 20 | reportResults 21 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_build_2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" docker buildx version 10 | check "docker-build" docker build ./ 11 | check "docker-buildx" bash -c "docker buildx version" 12 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 13 | 14 | # Report result 15 | reportResults 16 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_build_no_compose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" docker buildx version 10 | check "docker-build" docker build ./ 11 | 12 | check "not installing compose skips docker-compose v1 install" bash -c "! type docker-compose" 13 | check "not installing compose skips compose-switch" bash -c "[[ ! -f /usr/local/bin/compose-switch ]]" 14 | 15 | # Report result 16 | reportResults 17 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_build_older.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" docker buildx version 10 | check "docker-build" docker build ./ 11 | check "docker-buildx" bash -c "docker buildx version" 12 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 13 | 14 | # Report result 15 | reportResults 16 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_buildx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" bash -c "docker buildx version" 10 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 11 | 12 | check "docker-buildx" docker buildx version 13 | check "docker-build" docker build ./ 14 | 15 | check "installs docker-compose v1 install" bash -c "type docker-compose" 16 | check "installs compose-switch" bash -c "[[ -f /usr/local/bin/compose-switch ]]" 17 | 18 | # Report result 19 | reportResults 20 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_compose_v1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | 10 | check "docker-compose" bash -c "docker-compose version | grep -E '1.[0-9]+.[0-9]+'" 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_compose_v2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | 10 | check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'" 11 | check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'" 12 | check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]" 13 | check "installs compose-switch" bash -c "[[ -f /usr/local/bin/compose-switch ]]" 14 | 15 | # Report result 16 | reportResults 17 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_python_bookworm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" bash -c "docker buildx version" 10 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 11 | 12 | check "docker-buildx" docker buildx version 13 | check "docker-build" docker build ./ 14 | 15 | check "installs docker-compose v2 install" bash -c "type docker-compose" 16 | check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'" 17 | check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'" 18 | 19 | check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]" 20 | 21 | # Report result 22 | reportResults 23 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_specific_moby_buildx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | # Definition specific tests 8 | check "moby-buildx" bash -c "dpkg-query -W moby-buildx | grep -E '0.12.0'" 9 | 10 | check "docker-buildx" bash -c "docker buildx version" 11 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 12 | 13 | check "docker-buildx" docker buildx version 14 | check "docker-build" docker build ./ 15 | 16 | check "installs docker-compose v1 install" bash -c "type docker-compose" 17 | check "installs compose-switch" bash -c "[[ -f /usr/local/bin/compose-switch ]]" 18 | 19 | # Report result 20 | reportResults 21 | -------------------------------------------------------------------------------- /test/docker-in-docker/docker_with_on_create_command.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Feature specific tests 9 | check "version" docker --version 10 | check "docker-ps" bash -c "docker ps" 11 | 12 | check "docker-init-exists" bash -c "ls /usr/local/share/docker-init.sh" 13 | check "log-exists" bash -c "ls /tmp/dockerd.log" 14 | check "log-for-completion" bash -c "cat /tmp/dockerd.log | grep 'Daemon has completed initialization'" 15 | check "log-contents" bash -c "cat /tmp/dockerd.log | grep 'API listen on /var/run/docker.sock'" 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/pin_docker-ce_version_moby_false.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Optional: Import test library 4 | source dev-container-features-test-lib 5 | 6 | check "docker-ce" bash -c "docker --version" 7 | check "docker-ce-cli" bash -c "docker version" 8 | 9 | #report result 10 | reportResults -------------------------------------------------------------------------------- /test/docker-in-docker/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Feature specific tests 9 | check "version" docker --version 10 | check "docker-init-exists" bash -c "ls /usr/local/share/docker-init.sh" 11 | check "docker-ps" bash -c "docker ps" 12 | check "log-exists" bash -c "ls /tmp/dockerd.log" 13 | check "log-for-completion" bash -c "cat /tmp/dockerd.log | grep 'Daemon has completed initialization'" 14 | check "log-contents" bash -c "cat /tmp/dockerd.log | grep 'API listen on /var/run/docker.sock'" 15 | check "moby-buildx" bash -c "dpkg-query -W moby-buildx" 16 | 17 | # Report result 18 | reportResults -------------------------------------------------------------------------------- /test/docker-outside-of-docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:jammy 2 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" docker buildx version 10 | check "docker-build" docker build ./ 11 | 12 | check "installs docker-compose v1 install" bash -c "type docker-compose" 13 | 14 | # Report result 15 | reportResults 16 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_build_moby.sh: -------------------------------------------------------------------------------- 1 | ./docker_build.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_build_no_buildx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "no buildx" bash -c "docker buildx version 2>&1 | grep 'not a docker command'" 10 | check "docker-build" docker build ./ 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_build_no_buildx_moby.sh: -------------------------------------------------------------------------------- 1 | ./docker_build_no_buildx.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_build_no_compose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" docker buildx version 10 | check "docker-build" docker build ./ 11 | 12 | check "not installing compose skips docker-compose v1 install" bash -c "! type docker-compose" 13 | 14 | # Report result 15 | reportResults 16 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_dash_compose_v1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'" 10 | check "docker-compose" bash -c "docker-compose --version | grep -E '1.[0-9]+.[0-9]+'" 11 | 12 | # Report result 13 | reportResults 14 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_dash_compose_v1_moby.sh: -------------------------------------------------------------------------------- 1 | ./docker_dash_compose_v1.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_dash_compose_v2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'" 10 | check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'" 11 | 12 | check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]" 13 | 14 | # Report result 15 | reportResults 16 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_dash_compose_v2_moby.sh: -------------------------------------------------------------------------------- 1 | ./docker_dash_compose_v2.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | check "docker buildx" bash -c "docker buildx version" 9 | check "docker compose" bash -c "docker compose version" 10 | check "docker-compose" bash -c "docker-compose --version" 11 | 12 | check "docker-init-exists" bash -c "ls /usr/local/share/docker-init.sh" 13 | check "log-exists" bash -c "ls /tmp/vscr-docker-from-docker.log" 14 | check "log-contents-for-success" bash -c "cat /tmp/vscr-docker-from-docker.log | grep 'Success'" 15 | 16 | check "log-contents" bash -c "cat /tmp/vscr-docker-from-docker.log | grep 'Ensuring vscode has access to /var/run/docker-host.sock via /var/run/docker.sock'" 17 | check "docker-ps" bash -c "docker ps >/dev/null" 18 | 19 | # Report result 20 | reportResults -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_init_debian.sh: -------------------------------------------------------------------------------- 1 | ./docker_init.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_init_moby.sh: -------------------------------------------------------------------------------- 1 | ./docker_init.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_init_ubuntu_22.sh: -------------------------------------------------------------------------------- 1 | ./docker_init.sh -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_install_compose_switch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Check if compose-switch is installed 9 | check_compose_switch_installation() { 10 | COMPOSE_SWITCH_BINARY="/usr/local/bin/compose-switch" 11 | # Check if the binary exists 12 | if [ ! -x "$COMPOSE_SWITCH_BINARY" ]; then 13 | echo "compose-switch binary not found at $COMPOSE_SWITCH_BINARY" 14 | exit 1 15 | else 16 | compose_switch_version=$("$COMPOSE_SWITCH_BINARY" --version | awk '{print $4}') 17 | if [ -z "$compose_switch_version" ]; then 18 | echo "Unable to determine compose-switch version" 19 | else 20 | echo "compose-switch version: $compose_switch_version" 21 | echo -e "\n✅ compose-switch is installed" 22 | fi 23 | fi 24 | } 25 | 26 | check "Check whether compose-switch is installed" check_compose_switch_installation 27 | 28 | reportResults 29 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_not_install_compose_switch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Check if compose-switch is installed 9 | check_compose_switch_installation() { 10 | COMPOSE_SWITCH_BINARY="/usr/local/bin/compose-switch" 11 | # Check if the binary exists 12 | if [ ! -x "$COMPOSE_SWITCH_BINARY" ]; then 13 | echo "compose-switch binary not found at $COMPOSE_SWITCH_BINARY" 14 | echo -e "\n❎ compose-switch is not installed" 15 | else 16 | compose_switch_version=$("$COMPOSE_SWITCH_BINARY" --version | awk '{print $4}') 17 | if [ -z "$compose_switch_version" ]; then 18 | echo "Unable to determine compose-switch version" 19 | else 20 | echo "compose-switch version: $compose_switch_version" 21 | fi 22 | exit 1 23 | fi 24 | } 25 | 26 | check "Check whether compose-switch is installed" check_compose_switch_installation 27 | 28 | reportResults 29 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_python_bookworm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | # Definition specific tests 9 | check "docker-buildx" bash -c "docker buildx version" 10 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 11 | 12 | check "docker-buildx" docker buildx version 13 | check "docker-build" docker build ./ 14 | 15 | check "installs docker-compose v2 install" bash -c "type docker-compose" 16 | check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'" 17 | check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'" 18 | 19 | check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]" 20 | 21 | # Report result 22 | reportResults -------------------------------------------------------------------------------- /test/docker-outside-of-docker/docker_specific_moby_buildx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | # Definition specific tests 8 | check "moby-buildx" bash -c "dpkg-query -W moby-buildx | grep -E '0.12.0'" 9 | 10 | check "docker-buildx" bash -c "docker buildx version" 11 | check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx" 12 | 13 | check "docker-buildx" docker buildx version 14 | check "docker-build" docker build ./ 15 | 16 | check "installs docker-compose v1 install" bash -c "type docker-compose" 17 | 18 | # Report result 19 | reportResults 20 | -------------------------------------------------------------------------------- /test/docker-outside-of-docker/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library 6 | source dev-container-features-test-lib 7 | 8 | check "docker buildx" bash -c "docker buildx version" 9 | check "docker compose" bash -c "docker compose version" 10 | check "docker-compose" bash -c "docker-compose --version" 11 | 12 | check "docker-ps" bash -c "docker ps >/dev/null" 13 | check "moby-buildx" bash -c "dpkg-query -W moby-buildx" 14 | 15 | # Report result 16 | reportResults -------------------------------------------------------------------------------- /test/dotnet/dotnet_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export DOTNET_NOLOGO=true 3 | export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true 4 | export DOTNET_GENERATE_ASPNET_CERTIFICATE=false -------------------------------------------------------------------------------- /test/dotnet/install_aspnetcore_runtime_only.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Optional: Import test library bundled with the devcontainer CLI 6 | # See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib 7 | # Provides the 'check' and 'reportResults' commands. 8 | source dev-container-features-test-lib 9 | 10 | # Feature-specific tests 11 | # The 'check' command comes from the dev-container-features-test-lib. Syntax is... 12 | # check