vscode-dev-containers/script-library
Samruddhi Khandale 89de5ff387
Update settings.env to include bookworm
2023-06-13 15:42:45 -07:00
..
container-features update docs 2022-09-07 00:04:00 +00:00
docs Update script-library/docs/maven.md 2022-09-07 09:16:39 -07:00
shared Update settings.env to include bookworm 2023-06-13 15:42:45 -07:00
test regression test for 02f8359b1f 2022-08-22 22:33:25 +00:00
README.md Refactor Python package installer (#1437) 2022-05-10 11:18:52 -04:00
awscli-debian.sh AWS CLI - GPG Fix (#1391) 2022-04-04 10:57:41 -05:00
azcli-debian.sh Azure CLI now available for Jammy from apt (#1559) 2022-08-01 13:02:43 -04:00
common-alpine.sh Fix "Add add sudo support.." typo (#1569) 2022-08-12 12:54:45 -04:00
common-debian.sh Fix "Add add sudo support.." typo (#1569) 2022-08-12 12:54:45 -04:00
common-redhat.sh Fix "Add add sudo support.." typo (#1569) 2022-08-12 12:54:45 -04:00
desktop-lite-debian.sh update all feature scripts to support `jammy` (& update regression testing parameters) (#1464) 2022-05-24 09:27:20 -07:00
docker-debian.sh Fix docker compose command v2 when not using moby (#1522) 2022-07-15 12:50:24 -07:00
docker-in-docker-debian.sh Make azure dns auto detection variable quoted in comparison (#1670) 2022-10-17 08:01:42 -07:00
docker-redhat.sh trim minor version from VERSION_ID (#1297) 2022-02-08 07:12:37 -08:00
dotnet-debian.sh update all feature scripts to support `jammy` (& update regression testing parameters) (#1464) 2022-05-24 09:27:20 -07:00
fish-debian.sh Fix Fish shell installation (#1503) 2022-06-21 10:39:29 -04:00
git-from-src-debian.sh update git/python/azure scripts (#1085) 2021-10-01 06:33:55 -07:00
git-lfs-debian.sh Add arm64, jammy to apt download list for git lfs (#1561) 2022-08-01 14:16:42 -04:00
github-debian.sh backport from 023d623196/src/github-cli/install.sh 2022-10-06 09:21:46 -07:00
go-debian.sh Resolve unexpected failure in Go, tighten logic fallback logic (#1403) 2022-04-12 15:37:32 -07:00
gradle-debian.sh Start of JDK 17 support, build system support for multiple build args for a variant (#1113) 2021-10-15 10:06:21 -07:00
homebrew-debian.sh Update Homebrew script (#1416) 2022-04-25 12:21:55 -04:00
java-debian.sh Work around issue with SDKMAN's default not downloading 2022-03-18 15:09:45 +00:00
jupyterlab-debian.sh Fix NotebookApp bug in Jupyter install script (#1469) 2022-05-24 14:55:19 -07:00
kubectl-helm-debian.sh Spelling correction: Minkube -> Minikube (#1534) 2022-07-15 13:14:39 -07:00
maven-debian.sh Start of JDK 17 support, build system support for multiple build args for a variant (#1113) 2021-10-15 10:06:21 -07:00
node-debian.sh update codespaces-linux dockerfile and revert script change 2022-04-25 01:03:52 +00:00
powershell-debian.sh Add bullseye, jammy to apt download list for PowerShell (#1560) 2022-08-01 14:18:08 -04:00
python-debian.sh sync python scripts 2022-07-27 18:12:18 +00:00
ruby-debian.sh Remove explicit debase install for Ruby script (#1244) 2022-01-07 11:43:18 -08:00
rust-debian.sh rust-debian.sh: fix set -e interaction with nightly rust detection (#1592) 2022-08-22 18:29:03 -04:00
sshd-debian.sh backport: https://github.com/devcontainers/features/pull/96 (#1582) 2022-08-22 18:10:57 -04:00
terraform-debian.sh Regression fixes for stretch, fallback logic 2021-09-26 17:40:55 +00:00

README.md

Development Container Scripts

This folder contains a set of scripts that can be referenced by Dockerfiles in development container "definitions" that are found under the containers directory. You are also free to use them in your own dev container configurations.

Scripts

Script names end in the Linux distribution "tree" they support. The majority are for Ubuntu/Debian.

  • Debian or Ubuntu: -debian
  • Alpine Linux: -alpine
  • CentOS, RHEL: -redhat (when the yum package manager is available - usually community supported).

Some scripts have special installation instructions (like desktop-lite-debian.sh). Consult the following documents for more information (in order of the script name):

Document Script Maintainers
AWS CLI Install Script awscli-debian.sh VS Code and GitHub Codespaces teams
Azure CLI Install Script azcli-debian.sh VS Code and GitHub Codespaces teams
Common Script common-debian.sh
common-alpine.sh
common-redhat.sh (Community)
VS Code and GitHub Codespaces teams
Desktop (Lightweight) Install Script desktop-lite-debian.sh VS Code and GitHub Codespaces teams
Docker-in-Docker Install Script docker-in-docker-debian.sh VS Code and GitHub Codespaces teams
Docker-from-Docker Install Script docker-debian.sh
docker-redhat.sh (Community)
VS Code and GitHub Codespaces teams, @smankoo (docker-redhat.sh)
Dotnet Install Script dotnet-debian.sh VS Code and GitHub Codespaces teams
fish Install Script fish-debian.sh (Community) @andreiborisov
Git Build/Install from Source Script git-from-src-debian.sh VS Code and GitHub Codespaces teams
Git LFS Install Script git-lfs-debian.sh VS Code and GitHub Codespaces teams
GitHub CLI Install Script github-debian.sh VS Code and GitHub Codespaces teams
Go (golang) Install Script go-debian.sh VS Code and GitHub Codespaces teams
Gradle Install Script gradle-debian.sh VS Code and GitHub Codespaces teams
Homebrew Install Script homebrew-debian.sh (Community) @andreiborisov
Java Install Script java-debian.sh VS Code and GitHub Codespaces teams
JupyterLab Install Script jupyterlab-debian.sh VS Code and GitHub Codespaces teams
Kubectl and Helm Install Script kubectl-helm-debian.sh VS Code and GitHub Codespaces teams
Maven Install Script maven-debian.sh VS Code and GitHub Codespaces teams
Node.js Install Script node-debian.sh VS Code and GitHub Codespaces teams
PowerShell Install Script powershell-debian.sh VS Code and GitHub Codespaces teams
Python Install Script python-debian.sh VS Code and GitHub Codespaces teams
Ruby Install Script ruby-debian.sh VS Code and GitHub Codespaces teams
Rust (rustlang) Install Script rust-debian.sh VS Code and GitHub Codespaces teams
SSH Server Install Script sshd-debian.sh VS Code and GitHub Codespaces teams
Terraform CLI Install Script terraform-debian.sh VS Code and GitHub Codespaces teams

Using a script

See the documentation above for specific instructions on individual scripts. This section will outline some general tips for alternate ways to reference the scripts in your Dockerfile.

Copying the script to .devcontainer/library-scripts

The easiest way to use a script is to simply copy it into a .devcontainers/library-scripts folder. From here you can then use the script as follows in your Dockerfile:

Debian/Ubuntu

COPY library-scripts/*.sh /tmp/library-scripts/
RUN bash /tmp/library-scripts/common-debian.sh

Generally it's also good to clean up after running a script in the same RUN statement to keep the "layer" small.

COPY library-scripts/*.sh /tmp/library-scripts/
RUN bash /tmp/library-scripts/common-debian.sh
    && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

Alpine

COPY library-scripts/*.sh /tmp/library-scripts/
RUN ash /tmp/library-scripts/common-alpine.sh \
    && rm -rf /tmp/library-scripts

CentOS/RedHat/Oracle Linux

COPY library-scripts/*.sh /tmp/library-scripts/
RUN bash /tmp/library-scripts/common-redhat.sh \
    && yum clean all && rm -rf /tmp/library-scripts

Note that the CI process for this repository will automatically keep scripts in the .devcontainers/library-scripts folder up to date for each definition in the containers folder.

Downloading the script with curl / wget instead

If you prefer, you can download the script using curl or wget and execute it instead. This can convenient to do with your own Dockerfile, but is generally avoided for definitions in this repository. To avoid unexpected issues, you should reference a release specific version of the script, rather than using main. For example:

RUN bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh")" \
    && apt-get clean -y && rm -rf /var/lib/apt/lists/*

Or if you're not sure if curl is installed:

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive  \
    && apt-get -y install --no-install-recommends curl ca-certificates \
    && bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh")" \
    && apt-get clean -y && rm -rf /var/lib/apt/lists/*

As before, the last line is technically optional, but minimizes the size of the layer by removing temporary contents.

You can also use wget:

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive  \
    && apt-get -y install --no-install-recommends wget ca-certificates \
    && bash -c "$(wget -qO- "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh")" \
    && apt-get clean -y && rm -rf /var/lib/apt/lists/*

Arguments

Some scripts include arguments that you can allow developers to set by using ARG in your Dockerfile.

Using arguments with scripts from the .devcontainers/library-scripts folder

In this case, you can simply pass in the arguments to the script.

# Options for script
ARG INSTALL_ZSH="true"

COPY library-scripts/*.sh /tmp/library-scripts/
RUN /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "vscode" "1000" "1000" "true" "true" "true"\
    && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

Using arguments when downloading with curl

The trick here is to use the double-dashes (--) after the bash -c command and then listing the arguments.

# Options for script
ARG INSTALL_ZSH="true"

# Download script and run it with the option above
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive  \
    && apt-get -y install --no-install-recommends curl ca-certificates \
    && bash -c "$(curl -fsSL "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh")" -- "${INSTALL_ZSH}" "vscode" "1000" "1000" "true" \
    && apt-get clean -y && rm -rf /var/lib/apt/lists/*

Testing

The test/regression sub-folder includes Debian, Alpine, and RedHat based dev containers that can be used to test the scripts.

Contributing

See CONTRIBUTING.md for details on contributing definitions to this repository.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See LICENSE