From 78587413a1832bb944c4e7fa9a937e5bb6e9706e Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Tue, 15 Oct 2019 20:07:49 +0200 Subject: [PATCH] Add support for working inside a Docker Container with VS Code --- .devcontainer/devcontainer.json | 43 +++++++++++++++++++++++++++++++++ .vscode/tasks.json | 13 ++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..831e71d3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,43 @@ +// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at +// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-existing-dockerfile +{ + "name": "Existing Dockerfile", + + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerFile": "../Dockerfile", + + // The optional 'runArgs' property can be used to specify additional runtime arguments. + "runArgs": [ + // Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-in-docker for details. + // "-v","/var/run/docker.sock:/var/run/docker.sock", + + // Uncomment the next line if you will be using a ptrace-based debugger like C++, Go, and Rust. + // "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" + + // You may want to add a non-root user to your Dockerfile. On Linux, this will prevent + // new files getting created as root. See https://aka.ms/vscode-remote/containers/non-root-user + // for the needed Dockerfile updates and then uncomment the next line. + // "-u", "vscode" + ], + + // Use 'settings' to set *default* container specific settings.json values on container create. + // You can edit these settings after create using File > Preferences > Settings > Remote. + "settings": { + // This will ignore your local shell user setting for Linux since shells like zsh are typically + // not in base container images. You can also update this to an specific shell to ensure VS Code + // uses the right one for terminals and tasks. For example, /bin/bash (or /bin/ash for Alpine). + "terminal.integrated.shell.linux": null + }, + + // Uncomment the next line if you want to publish any ports. + // "appPort": [], + + // Uncomment the next line to run commands after the container is created - for example installing git. + "postCreateCommand": "apk update && apk add git", + + // Add the IDs of extensions you want installed when the container is created in the array below. + "extensions": ["ms-python.python", "lextudio.restructuredtext"] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..2fa8bd29 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Make HTML", + "type": "shell", + "command": "make html", + "options": {"cwd": "${workspaceRoot}/docs"} + } + ] +} \ No newline at end of file