Skip to content

Instantly share code, notes, and snippets.

@peterotool
Created July 16, 2023 01:30
Show Gist options
  • Save peterotool/5206651b7db4f797b41a768c77117b15 to your computer and use it in GitHub Desktop.
Save peterotool/5206651b7db4f797b41a768c77117b15 to your computer and use it in GitHub Desktop.
Dev Containers

Dev Containers

Create .devcontainer/devcontainer.json configuration file

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
	"name": "Existing Dockerfile",
	"build": {
		// 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"
	},
	// Features to add to the dev container. More info: https://containers.dev/features.
	// "features": {},
	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],
	// Uncomment the next line to run commands after the container is created.
	// "postCreateCommand": "cat /etc/os-release",
	// Configure tool-specific properties.
	"customizations": {
		// Configure properties specific to VS Code.
		"vscode": {
			// Set *default* container specific settings.json values on container create.
			"settings": {
				"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
				"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
				"python.linting.pylintEnabled": true
			},
			"extensions": [
				"ms-python.python",
				"ms-python.vscode-pylance"
			],
		}
	}
	// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
	// "remoteUser": "devcontainer"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment