### Install Additional Go Packages Source: https://github.com/devcontainers/templates/blob/main/src/go-postgres/README.md Modify the Go Dockerfile by adding `RUN` commands to install extra packages. This example shows how to add a new package using `go get`. ```yaml # This line can be modified to add any needed additional packages RUN go get -x ``` -------------------------------- ### Start Apache Server Source: https://github.com/devcontainers/templates/blob/main/src/php-mariadb/NOTES.md Command to start the Apache web server within the dev container. Apache will be accessible on port 8080. ```bash apache2ctl start ``` -------------------------------- ### Execute Post-Creation Commands Source: https://github.com/devcontainers/templates/blob/main/src/java-postgres/README.md Use the 'postCreateCommand' property in devcontainer.json to run commands automatically after the container is created. This is useful for verifying tool installations or performing initial setup. ```json { "postCreateCommand": "java -version && git --version && node --version" } ``` -------------------------------- ### Start Jupyter Notebook in devcontainer.json Source: https://github.com/devcontainers/templates/blob/main/src/anaconda-postgres/README.md Configure the `postStartCommand` in `.devcontainer/devcontainer.json` to automatically start the Jupyter notebook web app. Use `nohup` to ensure it continues running and logs to `nohup.out`. ```json // Use 'postStartCommand' to run commands after the container is created. "postStartCommand": "nohup bash -c 'jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root &'", ``` -------------------------------- ### Basic CMake Project Configuration Source: https://github.com/devcontainers/templates/blob/main/test/cpp-mariadb/CMakeLists.txt Sets the minimum CMake version and project name. This is a standard starting point for any CMake project. ```cmake cmake_minimum_required(VERSION 3.0.0) project(test-project VERSION 0.1.0) ``` -------------------------------- ### Configure Java Dev Container Source: https://context7.com/devcontainers/templates/llms.txt Sets up a Java development environment with optional Maven and Gradle installation. The `features` block configures the Java tooling, and `postCreateCommand` checks the Java version. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/java:5 { "name": "Java", "image": "mcr.microsoft.com/devcontainers/java:3-21-trixie", "features": { // Installs the selected Java tooling via the official Feature "ghcr.io/devcontainers/features/java:1": { "version": "none", "installMaven": "true", "installGradle": "false" } }, "postCreateCommand": "java -version" } // Apply with Maven enabled // devcontainer templates apply \ // --workspace-folder . \ // --template-id ghcr.io/devcontainers/templates/java:5 \ // --template-args '{ "imageVariant": "21-trixie", "installMaven": "true", "installGradle": "false" }' ``` -------------------------------- ### Node.js & PostgreSQL Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Sets up a Node.js and PostgreSQL multi-container environment using Docker Compose. The PostgreSQL container includes a health check before the Node.js app container starts. Installs Node.js dependencies on creation. ```jsonc // .devcontainer/devcontainer.json { "name": "Node.js & PostgreSQL", "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "forwardPorts": [3000, 5432], "postCreateCommand": "yarn install" } ``` ```yaml // Companion docker-compose.yml (full) // volumes: // postgres-data: // services: // app: // build: { context: ., dockerfile: Dockerfile } // volumes: ["../..:/workspaces:cached"] // command: sleep infinity // depends_on: { db: { condition: service_healthy } } // networks: [app-network] // db: // image: postgres:latest // restart: unless-stopped // networks: [app-network] // healthcheck: // test: ["CMD-SHELL", "pg_isready -U postgres"] // interval: 10s // timeout: 5s // retries: 5 // environment: { POSTGRES_PASSWORD: postgres, POSTGRES_USER: postgres, POSTGRES_DB: postgres } // networks: // app-network: { driver: bridge } ``` -------------------------------- ### Install Prospector with Pipx Source: https://github.com/devcontainers/templates/blob/main/src/miniconda/NOTES.md Use pipx to install Python development utilities in an isolated environment. This avoids impacting the global Python installation. ```bash pipx install prospector ``` -------------------------------- ### Execute Post-Container Creation Commands Source: https://github.com/devcontainers/templates/blob/main/src/cpp-mariadb/NOTES.md Use the 'postCreateCommand' property in devcontainer.json to run commands automatically after the container is created. This example checks the versions of g++ and git. ```json "postCreateCommand": "g++ --version && git --version" ``` -------------------------------- ### Configure C# (.NET) and MS SQL Dev Container Source: https://context7.com/devcontainers/templates/llms.txt This setup creates a full-stack C# + Microsoft SQL Server environment using Docker Compose. It configures VS Code settings for MSSQL connections and includes a `postCreateCommand` to wait for SQL Server readiness before running migrations. ```jsonc // .devcontainer/devcontainer.json { "name": "C# (.NET) and MS SQL", "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "customizations": { "vscode": { "settings": { "mssql.connections": [{ "server": "localhost,1433", "database": "", "authenticationType": "SqlLogin", "user": "sa", "password": "P@ssw0rd", "savePassword": false, "profileName": "mssql-container" }] }, "extensions": ["ms-dotnettools.csharp", "ms-mssql.mssql"] } }, // $1=SA password, $2=dacpac path, $3=sql scripts path "postCreateCommand": "bash .devcontainer/mssql/postCreateCommand.sh 'P@ssw0rd' './bin/Debug/' './.devcontainer/mssql/'" } // Companion docker-compose.yml (excerpt) // services: // app: // build: { context: ., dockerfile: Dockerfile } // volumes: ["../..:/workspaces:cached"] // command: sleep infinity // network_mode: service:db // db: // image: mcr.microsoft.com/mssql/server:2019-latest // environment: { SA_PASSWORD: "P@ssw0rd", ACCEPT_EULA: "Y" } ``` -------------------------------- ### Install Specific Python Version in Dockerfile Source: https://github.com/devcontainers/templates/blob/main/src/anaconda-postgres/NOTES.md Use this RUN command in a Dockerfile to install a different Python version when building the image. ```dockerfile RUN conda install -y python=3.6 ``` -------------------------------- ### Anaconda (Python 3) Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Sets up a Python 3 data science environment using Anaconda. Installs conda dependencies from an `environment.yml` file located at the project root. Includes the Python VS Code extension. Uses a custom Dockerfile for conda environment setup. ```jsonc // .devcontainer/devcontainer.json (uses a custom Dockerfile for conda env setup) { "name": "Anaconda (Python 3)", "build": { "context": "..", "dockerfile": "Dockerfile" }, "postCreateCommand": "python --version" } ``` ```yaml // environment.yml (placed at project root, auto-installed by the Dockerfile) // name: base // channels: // - defaults // dependencies: // - python=3.10 // - numpy // - pandas // - scikit-learn // - jupyter ``` -------------------------------- ### Jupyter Notebook Access URL Source: https://github.com/devcontainers/templates/blob/main/src/anaconda-postgres/README.md After starting the Jupyter notebook, view the terminal output for the correct URL, which includes an access token for authentication. ```bash http://127.0.0.1:8888/?token=1234567 ``` -------------------------------- ### Configure Docker Outside of Docker Source: https://context7.com/devcontainers/templates/llms.txt This setup shares the host's Docker socket with the dev container, allowing Docker commands to control the host's Docker daemon without a nested daemon. Configure the Docker version and non-root access. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/docker-outside-of-docker { "name": "Docker outside of Docker", "image": "mcr.microsoft.com/devcontainers/base:bullseye", "features": { "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { "version": "latest", "enableNonRootDocker": "true", "moby": "true" } }, // Exposes the host workspace path for bind-mounting into child containers "remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" }, "postCreateCommand": "docker --version" } ``` -------------------------------- ### Node.js & MongoDB Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Configures a Node.js and MongoDB multi-container environment. Includes the MongoDB for VS Code extension for direct database exploration. Forwards ports 3000 and 27017. Installs Node.js dependencies on creation. ```jsonc // .devcontainer/devcontainer.json { "name": "Node.js & Mongo DB", "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "customizations": { "vscode": { "extensions": ["mongodb.mongodb-vscode"] } }, "forwardPorts": [3000, 27017], "postCreateCommand": "yarn install" } ``` -------------------------------- ### C++ Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Configures a C++ development environment using a custom Dockerfile. Installs build tools like GCC, CMake, and GDB. Supports Debian 12/13 and Ubuntu 22.04/24.04. Includes VS Code extensions for C++ and CMake. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/cpp:4 { "name": "C++", // Builds from .devcontainer/Dockerfile which installs build-essential, cmake, gdb "build": { "dockerfile": "Dockerfile" }, "postCreateCommand": "gcc -v", "customizations": { "vscode": { "extensions": ["ms-vscode.cpptools", "ms-vscode.cmake-tools"] } } } ``` -------------------------------- ### Ruby on Rails & Postgres Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Configures a full-stack Ruby on Rails and PostgreSQL environment using Docker Compose. The app service connects to a PostgreSQL container via shared networking. Forwards ports 3000 and 5432. Installs gems and sets up the database on creation. ```jsonc // .devcontainer/devcontainer.json { "name": "Ruby on Rails & Postgres", "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "forwardPorts": [3000, 5432], "postCreateCommand": "bundle install && rake db:setup", "customizations": { "vscode": { "extensions": ["rebornix.Ruby", "wingrunr21.vscode-ruby"] } } } ``` -------------------------------- ### Basic CMakeLists.txt Configuration Source: https://github.com/devcontainers/templates/blob/main/test/cpp/CMakeLists.txt Sets the minimum CMake version, project name, and version. Enables testing and adds an executable. ```cmake cmake_minimum_required(VERSION 3.0.0) project(test-project VERSION 0.1.0) include(CTest) enable_testing() add_executable(test-project main.cpp) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) ``` -------------------------------- ### Configure Existing Dockerfile Source: https://context7.com/devcontainers/templates/llms.txt Use this template when your project already has a Dockerfile. It configures the dev container to build from your existing Dockerfile instead of pulling a prebuilt image. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/docker-existing-dockerfile { "name": "Existing Dockerfile", // Points at the project's own Dockerfile "build": { "dockerfile": "../Dockerfile", "context": ".." }, "forwardPorts": [], "postCreateCommand": "echo 'Container ready'" } ``` -------------------------------- ### Configure Go Dev Container Source: https://context7.com/devcontainers/templates/llms.txt Use this configuration for a Go development environment. It specifies the image, forwards port 8080, and sets a post-create command to check the Go version. VS Code extensions for Go are also included. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/go:6 { "name": "Go", "image": "mcr.microsoft.com/devcontainers/go:2-1.25-bookworm", "features": {}, "forwardPorts": [8080], "postCreateCommand": "go version", "customizations": { "vscode": { "extensions": ["golang.go"] } } } // Apply via CLI // devcontainer templates apply \ // --workspace-folder . \ // --template-id ghcr.io/devcontainers/templates/go:6 \ // --template-args '{ "imageVariant": "1.25-bookworm" }' ``` -------------------------------- ### Install Different Python Version in Dockerfile Source: https://github.com/devcontainers/templates/blob/main/src/miniconda/NOTES.md Install a different Python version and update pipx within a Dockerfile. This ensures the desired Python environment is set up during the image build process. ```dockerfile RUN conda install -y python=3.6 \ && pip install --no-cache-dir pipx \ && pipx uninstall pipx \ && pipx reinstall-all ``` -------------------------------- ### Install Specific Python Version with Conda Source: https://github.com/devcontainers/templates/blob/main/src/anaconda-postgres/README.md Install a different version of Python within the Anaconda environment using the conda package manager. This can be done interactively in a terminal or within a Dockerfile. ```bash conda install python=3.6 ``` ```Dockerfile RUN conda install -y python=3.6 ``` -------------------------------- ### Configure C# (.NET) Dev Container Source: https://context7.com/devcontainers/templates/llms.txt This configuration provides a C# and .NET development environment. It forwards common ports for web applications and includes a post-create command to restore .NET dependencies. VS Code C# extension is also specified. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/dotnet { "name": "C# (.NET)", "image": "mcr.microsoft.com/devcontainers/dotnet:2-9.0-bookworm", "forwardPorts": [5000, 5001], "portsAttributes": { "5001": { "protocol": "https" } }, "postCreateCommand": "dotnet restore", "customizations": { "vscode": { "extensions": ["ms-dotnettools.csharp"] } } } // Apply via CLI // devcontainer templates apply \ // --workspace-folder . \ // --template-id ghcr.io/devcontainers/templates/dotnet \ // --template-args '{ "imageVariant": "9.0-bookworm" }' ``` -------------------------------- ### Install Different Python Version with Conda Source: https://github.com/devcontainers/templates/blob/main/src/miniconda/NOTES.md Install a different Python version using conda and update pipx to ensure compatibility with the new Python environment. This is useful when the default Python version in the image is not suitable. ```bash conda install python=3.6 pip install --no-cache-dir pipx pipx uninstall pipx pipx reinstall-all ``` -------------------------------- ### Build Executable Source: https://github.com/devcontainers/templates/blob/main/test/cpp-mariadb/CMakeLists.txt Defines an executable target named 'test-project' built from the 'main.cpp' source file. Ensure 'main.cpp' exists in the same directory. ```cmake add_executable(test-project main.cpp) ``` -------------------------------- ### Configure Rust Dev Container Source: https://context7.com/devcontainers/templates/llms.txt This configuration sets up a Rust development environment. It includes a post-create command to check the Rust compiler version and mounts a volume to persist the Cargo cache between container rebuilds. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/rust:5 { "name": "Rust", "image": "mcr.microsoft.com/devcontainers/rust:2-1-bookworm", // Persist the Cargo cache between container rebuilds using a named volume "mounts": [ { "source": "devcontainer-cargo-cache-${devcontainerId}", "target": "/usr/local/cargo", "type": "volume" } ], "postCreateCommand": "rustc --version" } // Apply via CLI // devcontainer templates apply \ // --workspace-folder . \ // --template-id ghcr.io/devcontainers/templates/rust:5 \ // --template-args '{ "imageVariant": "bookworm" }' ``` -------------------------------- ### Move Certificate File in Dev Container Source: https://github.com/devcontainers/templates/blob/main/src/dotnet/NOTES.md After copying the PFX file into the dev container, use this bash command to create the necessary directory and move the certificate to its final location. ```bash mkdir -p $HOME/.aspnet/https && mv aspnetapp.pfx $HOME/.aspnet/https ``` -------------------------------- ### Update Conda Environment from YAML Source: https://github.com/devcontainers/templates/blob/main/src/anaconda-postgres/README.md This Dockerfile command automatically installs dependencies from the environment.yml file when the container is built. It ensures that all specified packages are added to the base Conda environment. ```Dockerfile RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ && rm -rf /tmp/conda-tmp ``` -------------------------------- ### Configure devcontainer.json for HTTPS Source: https://github.com/devcontainers/templates/blob/main/src/dotnet/NOTES.md Add these configurations to your `.devcontainer/devcontainer.json` file to set the environment variables for the certificate password and path, and to map the HTTPS port. ```json "remoteEnv": { "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", "ASPNETCORE_Kestrel__Certificates__Default__Path": "${containerEnv:HOME}/.aspnet/https/aspnetapp.pfx", }, "portsAttributes": { "5001": { "protocol": "https" } } ``` -------------------------------- ### Link Source Code to Apache Document Root Source: https://github.com/devcontainers/templates/blob/main/src/php-mariadb/NOTES.md Configure the `postCreateCommand` in devcontainer.json to create a symbolic link from the current directory to Apache's web root (`/var/www/html`). This makes source code directly accessible via Apache. ```json "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" ``` -------------------------------- ### Configure devcontainer.json for HTTPS Source: https://github.com/devcontainers/templates/blob/main/src/dotnet/README.md Add these configurations to your `.devcontainer/devcontainer.json` file to set environment variables for the certificate password and path, and to configure port attributes for HTTPS. ```json "remoteEnv": { "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", "ASPNETCORE_Kestrel__Certificates__Default__Path": "${containerEnv:HOME}/.aspnet/https/aspnetapp.pfx" }, "portsAttributes": { "5001": { "protocol": "https" } } ``` -------------------------------- ### Universal Linux Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt A multi-language universal container for GitHub Codespaces. It supports Python, Node.js, JavaScript, TypeScript, C++, Java, C#, .NET, PHP, Go, Ruby, and Conda. Apply via CLI using 'devcontainer templates apply'. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/universal:2 { "name": "Default Linux Universal", "image": "mcr.microsoft.com/devcontainers/universal:6-linux", "features": {}, "forwardPorts": [], "postCreateCommand": "uname -a", "customizations": { "vscode": { "extensions": ["ms-python.python", "golang.go"] } } } // Apply via CLI // devcontainer templates apply \ // --workspace-folder . \ // --template-id ghcr.io/devcontainers/templates/universal:2 ``` -------------------------------- ### Configure Kubernetes Local Configuration Source: https://context7.com/devcontainers/templates/llms.txt Integrates your dev container with local Kubernetes clusters by mounting host kubeconfig and minikube directories. This provides full kubectl and Helm access. Ensure Docker outside of Docker is also configured. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/kubernetes-helm { "name": "Kubernetes - Local Configuration", "image": "mcr.microsoft.com/devcontainers/base:bullseye", "features": { "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { "enableNonRootDocker": "true", "moby": "true" }, "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { "version": "latest", "helm": "latest", "minikube": "none" } }, "remoteEnv": { "SYNC_LOCALHOST_KUBECONFIG": "true" }, "initializeCommand": "cd .devcontainer && bash ensure-mount-sources", "mounts": [ { "source": "${env:HOME}${env:USERPROFILE}/.kube", "target": "/usr/local/share/kube-localhost", "type": "bind" }, { "source": "${env:HOME}${env:USERPROFILE}/.minikube", "target": "/usr/local/share/minikube-localhost", "type": "bind" } ], "postCreateCommand": "kubectl version" } ``` -------------------------------- ### Apply Dev Container Template CLI Command Source: https://github.com/devcontainers/templates/blob/main/README.md Use this command to apply a Dev Container Template to your project from a supported OCI registry. Specify the workspace folder, template ID, and optional arguments for template customization and feature inclusion. ```bash devcontainer templates apply Apply a template to the project Options: --help Show help [boolean] --version Show version number [boolean] -w, --workspace-folder Target workspace folder to apply Template [string] [required] [default: "."] -t, --template-id Reference to a Template in a supported OCI registry [string] [required] -a, --template-args Arguments to replace within the provided Template, provided as JSON [string] [default: "{}"] -f, --features Features to add to the provided Template, provided as JSON. [string] [default: "[]"] --log-level Log level. [choices: "info", "debug", "trace"] [default: "info"] --tmp-dir Directory to use for temporary files. If not provided, the system default will be inferred. [string] ``` ```bash devcontainer templates apply --workspace-folder . \ --template-id ghcr.io/devcontainers/templates/cpp:latest \ --template-args '{ "imageVariant": "debian-12" }' \ --features '[{ "id": "ghcr.io/devcontainers/features/azure-cli:1", "options": { "version" : "1" } }]' ``` -------------------------------- ### PHP Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Sets up a PHP development environment using the official Microsoft PHP image. Forwards port 8080 for the built-in web server. Supports selectable PHP versions on Debian Bookworm or Bullseye. Includes VS Code extensions for PHP debugging and IntelliSense. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/php { "name": "PHP", "image": "mcr.microsoft.com/devcontainers/php:3-8.3-bookworm", "forwardPorts": [8080], "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html", "customizations": { "vscode": { "extensions": ["xdebug.php-debug", "bmewburn.vscode-intelephense-client"] } } } ``` -------------------------------- ### Link Source Code to Apache Document Root (Terminal) Source: https://github.com/devcontainers/templates/blob/main/src/php-mariadb/NOTES.md Execute commands in a terminal to create a symbolic link from the current directory to Apache's web root (`/var/www/html`). This makes source code directly accessible via Apache. ```bash sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/html ``` -------------------------------- ### Configure Project Packaging with CPACK Source: https://github.com/devcontainers/templates/blob/main/test/cpp-mariadb/CMakeLists.txt Sets CPACK variables for project name and version, then includes the CPACK module to enable packaging. This is used for creating distributable packages. ```cmake set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) ``` -------------------------------- ### Configure ASP.NET HTTPS in devcontainer.json Source: https://github.com/devcontainers/templates/blob/main/src/dotnet-postgres/NOTES.md Configure environment variables for the certificate password and path, and set port attributes for HTTPS in `devcontainer.json` to enable secure connections for ASP.NET Core applications. ```json "remoteEnv": { "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", "ASPNETCORE_Kestrel__Certificates__Default__Path": "${containerEnv:HOME}/.aspnet/https/aspnetapp.pfx" }, "portsAttributes": { "5001": { "protocol": "https" } } ``` -------------------------------- ### Configure ASP.NET HTTPS in devcontainer.json Source: https://github.com/devcontainers/templates/blob/main/src/dotnet-mssql/NOTES.md Configure environment variables and port attributes in `.devcontainer/devcontainer.json` to enable HTTPS for ASP.NET applications using a custom certificate. ```json { "remoteEnv": { "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", "ASPNETCORE_Kestrel__Certificates__Default__Path": "${containerEnv:HOME}/.aspnet/https/aspnetapp.pfx" }, "portsAttributs": { "5001": { "protocol": "https" } } } ``` -------------------------------- ### Alpine Dev Container Configuration Source: https://context7.com/devcontainers/templates/llms.txt Defines a minimal Alpine Linux-based dev container. Use this for lightweight environments or shell scripting workflows. The `postCreateCommand` executes `uname -a` after container creation. ```jsonc // .devcontainer/devcontainer.json — applied from ghcr.io/devcontainers/templates/alpine { "name": "Alpine", "image": "mcr.microsoft.com/devcontainers/base:alpine-3.20", "postCreateCommand": "uname -a" } ``` ```bash // Apply via CLI // devcontainer templates apply \ // --workspace-folder . \ // --template-id ghcr.io/devcontainers/templates/alpine:3 \ // --template-args '{ "imageVariant": "3.20" }' ``` -------------------------------- ### Trust and Export ASP.NET Dev Certificate (Bash) Source: https://github.com/devcontainers/templates/blob/main/src/dotnet/NOTES.md Use this command in a macOS or Linux terminal to trust the local ASP.NET development certificate and export it to a PFX file with a specified password. ```bash dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" ```