diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2023-07-10 10:58:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 10:58:43 +0200 |
commit | c6271e29de838f98364c67edc9a2a6058da33613 (patch) | |
tree | 63b960bd8c7a60f6f3008f3a3f01488223a55030 | |
parent | f6640f4115db966e1453f2af6bb9cc7cfa34f774 (diff) |
Devcontainer tweaks (#518)
Various cleanup and minor tweaks to the devcontainer.
-rw-r--r-- | .devcontainer/Dockerfile | 18 | ||||
-rw-r--r-- | .devcontainer/devcontainer.json | 29 |
2 files changed, 9 insertions, 38 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b429c19..23d1761 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,21 +1,7 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3/.devcontainer/base.Dockerfile -# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster -ARG VARIANT="3.10-bullseye" +ARG VARIANT="3.11-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} -# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 ARG NODE_VERSION="none" -RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. -# COPY requirements.txt /tmp/pip-tmp/ -# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ -# && rm -rf /tmp/pip-tmp - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends <your-package-list-here> - -# [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
\ No newline at end of file +RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
\ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e389544..896cfdb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,24 +1,16 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3 +// For format details, see https://aka.ms/devcontainer.json { - "name": "Python 3", + "name": "gitlint", "build": { "dockerfile": "Dockerfile", "context": "..", "args": { - // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 - // Append -bullseye or -buster to pin to an OS version. - // Use -bullseye variants on local on arm64/Apple Silicon. - "VARIANT": "3.10", - // Options + "VARIANT": "3.11", "NODE_VERSION": "none" } }, - // Configure tool-specific properties. "customizations": { - // Configure properties specific to VS Code. "vscode": { - // Set *default* container specific settings.json values on container create. "settings": { "python.defaultInterpreterPath": "/usr/local/bin/python", "python.linting.enabled": true, @@ -34,9 +26,8 @@ "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", + "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle" }, - // Add the IDs of extensions you want installed when the container is created. "extensions": [ "ms-python.python", "ms-python.vscode-pylance", @@ -46,17 +37,11 @@ ] } }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "pip3 install --user -r requirements.txt", - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", + // See https://containers.dev/features "features": { - "git": "latest", - "github-cli": "latest", - "sshd": "latest", - "homebrew": "latest" + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} }, "postCreateCommand": "./.devcontainer/postCreateCommand.sh" }
\ No newline at end of file |