devcontainer

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package devcontainer parses devcontainer.json files and resolves the container image, mounts, environment, and post-create commands needed to spin up an isolated development shell.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name              string                 `json:"name"`
	Image             string                 `json:"image"`
	WorkspaceFolder   string                 `json:"workspaceFolder"`
	ContainerEnv      map[string]string      `json:"containerEnv"`
	RemoteUser        string                 `json:"remoteUser"`
	PostCreateCommand interface{}            `json:"postCreateCommand"` // string or []string
	Mounts            []interface{}          `json:"mounts"`            // string or object
	ForwardPorts      []int                  `json:"forwardPorts"`
	Features          map[string]interface{} `json:"features"`
}

Config represents the subset of the devcontainer.json spec that devx supports. See https://containers.dev/implementors/json_reference/

func Load

func Load(projectDir string) (*Config, string, error)

Load reads and parses a devcontainer.json file. It searches the standard locations: .devcontainer/devcontainer.json, .devcontainer.json, and .devcontainer/<name>/devcontainer.json.

func (*Config) PostCreateCmd

func (c *Config) PostCreateCmd() string

PostCreateCmd returns the post-create command as a single string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL