CircleCI-Public / circleci-cli

Use CircleCI from the command line

Home Page:https://circleci-public.github.io/circleci-cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Add DevContainer Enviroment (VS Code)

CodeMan99 opened this issue · comments

What problem does this feature solve?:

Ease of contributing. A fully configured IDE and tools as a single configuration file.

Provide an example:

I would like to suggest the following .devcontainer/devcontainer.json 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/go
{
	"name": "CircleCI CLI - Dev",
	"image": "mcr.microsoft.com/devcontainers/go:0-1.18-bullseye",

	// Configure tool-specific properties.
	"customizations": {
		// Configure properties specific to VS Code.
		"vscode": {
			"extensions": [
				"circleci.circleci",
				"golang.Go",
				"mads-hartmann.bash-ide-vscode",
				"ms-vscode.PowerShell",
				"rebornix.Ruby"
			],
			// Set *default* container specific settings.json values on container create.
			"settings": {
				"go.toolsManagement.checkForUpdates": "local",
				"go.useLanguageServer": true,
				"go.gopath": "/go"
			}
		}
	},

	// Features to add to the dev container. More info: https://containers.dev/features.
	"features": {
		"ghcr.io/devcontainers/features/docker-from-docker:1": {
			"version": "20.10"
		},
		"ghcr.io/devcontainers/features/git:1": {},
		"ghcr.io/devcontainers/features/powershell:1": {},
		"ghcr.io/devcontainers/features/ruby:1": {},
		// supports bash-ide-vscode extension.
		"ghcr.io/lukewiwa/features/shellcheck:0": {}
	}

	// 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": "go version",

	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
	// "remoteUser": "root"
}

While this looks highly opinionated, I simply looked at the files in this repo and added any extension or devcontainer feature that made sense. I may have added unnecessary tools.

Usage Requirements

Install the following tools:

Then open the repository with code . and run the "Dev Containers: Rebuild and Reopen in Container" command.

More Resources