dcspec
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package dcspec contains an automatically generated Devcontainerspecification.
Index¶
- type AppPortElement
- type BuildOptions
- type CacheFrom
- type Command
- type DevContainer
- type DevContainerAppPort
- type Features
- type ForwardPort
- type GPUClass
- type GPUEnum
- type GPUUnion
- type HostRequirements
- type Mount
- type MountElement
- type OnAutoForward
- type OtherPortsAttributes
- type PortsAttributes
- type Protocol
- type Secrets
- type ShutdownAction
- type Type
- type UserEnvProbe
- type WaitFor
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeAppPortElement¶
Application ports that are exposed by the container. This can be a single port or anarray of ports. Each port can be a number or a string. A number is mapped to the sameport on the host. A string is passed to Docker unchanged and can be used to map portsdifferently, e.g. "8000:8010".
func (*AppPortElement)MarshalJSON¶added inv2.22.0
func (x *AppPortElement) MarshalJSON() ([]byte,error)
func (*AppPortElement)UnmarshalJSON¶added inv2.22.0
func (x *AppPortElement) UnmarshalJSON(data []byte)error
typeBuildOptions¶
type BuildOptions struct {// The location of the context folder for building the Docker image. The path is relative to// the folder containing the `devcontainer.json` file.Context *string `json:"context,omitempty"`// The location of the Dockerfile that defines the contents of the container. The path is// relative to the folder containing the `devcontainer.json` file.Dockerfile *string `json:"dockerfile,omitempty"`// Build arguments.Args map[string]string `json:"args,omitempty"`// The image to consider as a cache. Use an array to specify multiple images.CacheFrom *CacheFrom `json:"cacheFrom"`// Additional arguments passed to the build command.Options []string `json:"options,omitempty"`// Target stage in a multi-stage build.Target *string `json:"target,omitempty"`}
Docker build-related options.
typeCacheFrom¶
The image to consider as a cache. Use an array to specify multiple images.
The name of the docker-compose file(s) used to start the services.
func (*CacheFrom)MarshalJSON¶added inv2.22.0
func (*CacheFrom)UnmarshalJSON¶added inv2.22.0
typeCommand¶
A command to run locally (i.e Your host machine, cloud VM) before anything else. Thiscommand is run before "onCreateCommand". If this is a single string, it will be run in ashell. If this is an array of strings, it will be run as a single command without shell.If this is an object, each provided command will be run in parallel.
A command to run when creating the container. This command is run after"initializeCommand" and before "updateContentCommand". If this is a single string, itwill be run in a shell. If this is an array of strings, it will be run as a singlecommand without shell. If this is an object, each provided command will be run inparallel.
A command to run when attaching to the container. This command is run after"postStartCommand". If this is a single string, it will be run in a shell. If this is anarray of strings, it will be run as a single command without shell. If this is an object,each provided command will be run in parallel.
A command to run after creating the container. This command is run after"updateContentCommand" and before "postStartCommand". If this is a single string, it willbe run in a shell. If this is an array of strings, it will be run as a single commandwithout shell. If this is an object, each provided command will be run in parallel.
A command to run after starting the container. This command is run after"postCreateCommand" and before "postAttachCommand". If this is a single string, it willbe run in a shell. If this is an array of strings, it will be run as a single commandwithout shell. If this is an object, each provided command will be run in parallel.
A command to run when creating the container and rerun when the workspace content wasupdated while creating the container. This command is run after "onCreateCommand" andbefore "postCreateCommand". If this is a single string, it will be run in a shell. Ifthis is an array of strings, it will be run as a single command without shell. If this isan object, each provided command will be run in parallel.
func (*Command)MarshalJSON¶added inv2.22.0
func (*Command)UnmarshalJSON¶added inv2.22.0
typeDevContainer¶
type DevContainer struct {// Docker build-related options.Build *BuildOptions `json:"build,omitempty"`// The location of the context folder for building the Docker image. The path is relative to// the folder containing the `devcontainer.json` file.Context *string `json:"context,omitempty"`// The location of the Dockerfile that defines the contents of the container. The path is// relative to the folder containing the `devcontainer.json` file.DockerFile *string `json:"dockerFile,omitempty"`// The docker image that will be used to create the container.Image *string `json:"image,omitempty"`// Application ports that are exposed by the container. This can be a single port or an// array of ports. Each port can be a number or a string. A number is mapped to the same// port on the host. A string is passed to Docker unchanged and can be used to map ports// differently, e.g. "8000:8010".AppPort *DevContainerAppPort `json:"appPort"`// Whether to overwrite the command specified in the image. The default is true.//// Whether to overwrite the command specified in the image. The default is false.OverrideCommand *bool `json:"overrideCommand,omitempty"`// The arguments required when starting in the container.RunArgs []string `json:"runArgs,omitempty"`// Action to take when the user disconnects from the container in their editor. The default// is to stop the container.//// Action to take when the user disconnects from the primary container in their editor. The// default is to stop all of the compose containers.ShutdownAction *ShutdownAction `json:"shutdownAction,omitempty"`// The path of the workspace folder inside the container.//// The path of the workspace folder inside the container. This is typically the target path// of a volume mount in the docker-compose.yml.WorkspaceFolder *string `json:"workspaceFolder,omitempty"`// The --mount parameter for docker run. The default is to mount the project folder at// /workspaces/$project.WorkspaceMount *string `json:"workspaceMount,omitempty"`// The name of the docker-compose file(s) used to start the services.DockerComposeFile *CacheFrom `json:"dockerComposeFile"`// An array of services that should be started and stopped.RunServices []string `json:"runServices,omitempty"`// The service you want to work on. This is considered the primary container for your dev// environment which your editor will connect to.Service *string `json:"service,omitempty"`// The JSON schema of the `devcontainer.json` file.Schema *string `json:"$schema,omitempty"`AdditionalProperties map[string]interface{} `json:"additionalProperties,omitempty"`// Passes docker capabilities to include when creating the dev container.CapAdd []string `json:"capAdd,omitempty"`// Container environment variables.ContainerEnv map[string]string `json:"containerEnv,omitempty"`// The user the container will be started with. The default is the user on the Docker image.ContainerUser *string `json:"containerUser,omitempty"`// Tool-specific configuration. Each tool should use a JSON object subproperty with a unique// name to group its customizations.Customizations map[string]interface{} `json:"customizations,omitempty"`// Features to add to the dev container.Features *Features `json:"features,omitempty"`// Ports that are forwarded from the container to the local machine. Can be an integer port// number, or a string of the format "host:port_number".ForwardPorts []ForwardPort `json:"forwardPorts,omitempty"`// Host hardware requirements.HostRequirements *HostRequirements `json:"hostRequirements,omitempty"`// Passes the --init flag when creating the dev container.Init *bool `json:"init,omitempty"`// A command to run locally (i.e Your host machine, cloud VM) before anything else. This// command is run before "onCreateCommand". If this is a single string, it will be run in a// shell. If this is an array of strings, it will be run as a single command without shell.// If this is an object, each provided command will be run in parallel.InitializeCommand *Command `json:"initializeCommand"`// Mount points to set up when creating the container. See Docker's documentation for the// --mount option for the supported syntax.Mounts []MountElement `json:"mounts,omitempty"`// A name for the dev container which can be displayed to the user.Name *string `json:"name,omitempty"`// A command to run when creating the container. This command is run after// "initializeCommand" and before "updateContentCommand". If this is a single string, it// will be run in a shell. If this is an array of strings, it will be run as a single// command without shell. If this is an object, each provided command will be run in// parallel.OnCreateCommand *Command `json:"onCreateCommand"`OtherPortsAttributes *OtherPortsAttributes `json:"otherPortsAttributes,omitempty"`// Array consisting of the Feature id (without the semantic version) of Features in the// order the user wants them to be installed.OverrideFeatureInstallOrder []string `json:"overrideFeatureInstallOrder,omitempty"`PortsAttributes *PortsAttributes `json:"portsAttributes,omitempty"`// A command to run when attaching to the container. This command is run after// "postStartCommand". If this is a single string, it will be run in a shell. If this is an// array of strings, it will be run as a single command without shell. If this is an object,// each provided command will be run in parallel.PostAttachCommand *Command `json:"postAttachCommand"`// A command to run after creating the container. This command is run after// "updateContentCommand" and before "postStartCommand". If this is a single string, it will// be run in a shell. If this is an array of strings, it will be run as a single command// without shell. If this is an object, each provided command will be run in parallel.PostCreateCommand *Command `json:"postCreateCommand"`// A command to run after starting the container. This command is run after// "postCreateCommand" and before "postAttachCommand". If this is a single string, it will// be run in a shell. If this is an array of strings, it will be run as a single command// without shell. If this is an object, each provided command will be run in parallel.PostStartCommand *Command `json:"postStartCommand"`// Passes the --privileged flag when creating the dev container.Privileged *bool `json:"privileged,omitempty"`// Remote environment variables to set for processes spawned in the container including// lifecycle scripts and any remote editor/IDE server process.RemoteEnv map[string]*string `json:"remoteEnv,omitempty"`// The username to use for spawning processes in the container including lifecycle scripts// and any remote editor/IDE server process. The default is the same user as the container.RemoteUser *string `json:"remoteUser,omitempty"`// Recommended secrets for this dev container. Recommendations are provided as environment// variable keys with optional metadata.Secrets *Secrets `json:"secrets,omitempty"`// Passes docker security options to include when creating the dev container.SecurityOpt []string `json:"securityOpt,omitempty"`// A command to run when creating the container and rerun when the workspace content was// updated while creating the container. This command is run after "onCreateCommand" and// before "postCreateCommand". If this is a single string, it will be run in a shell. If// this is an array of strings, it will be run as a single command without shell. If this is// an object, each provided command will be run in parallel.UpdateContentCommand *Command `json:"updateContentCommand"`// Controls whether on Linux the container's user should be updated with the local user's// UID and GID. On by default when opening from a local folder.UpdateRemoteUserUID *bool `json:"updateRemoteUserUID,omitempty"`// User environment probe to run. The default is "loginInteractiveShell".UserEnvProbe *UserEnvProbe `json:"userEnvProbe,omitempty"`// The user command to wait for before continuing execution in the background while the UI// is starting up. The default is "updateContentCommand".WaitFor *WaitFor `json:"waitFor,omitempty"`}
Defines a dev container
funcUnmarshalDevContainer¶added inv2.22.0
func UnmarshalDevContainer(data []byte) (DevContainer,error)
func (*DevContainer)Marshal¶added inv2.22.0
func (r *DevContainer) Marshal() ([]byte,error)
typeDevContainerAppPort¶
type DevContainerAppPort struct {Integer *int64String *stringUnionArray []AppPortElement}
Application ports that are exposed by the container. This can be a single port or anarray of ports. Each port can be a number or a string. A number is mapped to the sameport on the host. A string is passed to Docker unchanged and can be used to map portsdifferently, e.g. "8000:8010".
func (*DevContainerAppPort)MarshalJSON¶added inv2.22.0
func (x *DevContainerAppPort) MarshalJSON() ([]byte,error)
func (*DevContainerAppPort)UnmarshalJSON¶added inv2.22.0
func (x *DevContainerAppPort) UnmarshalJSON(data []byte)error
typeFeatures¶
type Features struct {Fish interface{} `json:"fish"`Gradle interface{} `json:"gradle"`Homebrew interface{} `json:"homebrew"`Jupyterlab interface{} `json:"jupyterlab"`Maven interface{} `json:"maven"`}
Features to add to the dev container.
typeForwardPort¶
func (*ForwardPort)MarshalJSON¶added inv2.22.0
func (x *ForwardPort) MarshalJSON() ([]byte,error)
func (*ForwardPort)UnmarshalJSON¶added inv2.22.0
func (x *ForwardPort) UnmarshalJSON(data []byte)error
typeGPUClass¶
type GPUClass struct {// Number of required cores.Cores *int64 `json:"cores,omitempty"`// Amount of required RAM in bytes. Supports units tb, gb, mb and kb.Memory *string `json:"memory,omitempty"`}
Indicates whether a GPU is required. The string "optional" indicates that a GPU isoptional. An object value can be used to configure more detailed requirements.
typeGPUUnion¶
func (*GPUUnion)MarshalJSON¶added inv2.22.0
func (*GPUUnion)UnmarshalJSON¶added inv2.22.0
typeHostRequirements¶
type HostRequirements struct {// Number of required CPUs.Cpus *int64 `json:"cpus,omitempty"`GPU *GPUUnion `json:"gpu"`// Amount of required RAM in bytes. Supports units tb, gb, mb and kb.Memory *string `json:"memory,omitempty"`// Amount of required disk space in bytes. Supports units tb, gb, mb and kb.Storage *string `json:"storage,omitempty"`}
Host hardware requirements.
typeMountElement¶
func (*MountElement)MarshalJSON¶added inv2.22.0
func (x *MountElement) MarshalJSON() ([]byte,error)
func (*MountElement)UnmarshalJSON¶added inv2.22.0
func (x *MountElement) UnmarshalJSON(data []byte)error
typeOnAutoForward¶
type OnAutoForwardstring
Defines the action that occurs when the port is discovered for automatic forwarding
const (IgnoreOnAutoForward = "ignore"NotifyOnAutoForward = "notify"OpenBrowserOnAutoForward = "openBrowser"OpenPreviewOnAutoForward = "openPreview"SilentOnAutoForward = "silent")
typeOtherPortsAttributes¶
type OtherPortsAttributes struct {// Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is// required if the local port is a privileged port.ElevateIfNeeded *bool `json:"elevateIfNeeded,omitempty"`// Label that will be shown in the UI for this port.Label *string `json:"label,omitempty"`// Defines the action that occurs when the port is discovered for automatic forwardingOnAutoForward *OnAutoForward `json:"onAutoForward,omitempty"`// The protocol to use when forwarding this port.Protocol *Protocol `json:"protocol,omitempty"`RequireLocalPort *bool `json:"requireLocalPort,omitempty"`}
typePortsAttributes¶
type PortsAttributes struct{}
typeSecrets¶
type Secrets struct{}
Recommended secrets for this dev container. Recommendations are provided as environmentvariable keys with optional metadata.
typeShutdownAction¶
type ShutdownActionstring
Action to take when the user disconnects from the container in their editor. The defaultis to stop the container.
Action to take when the user disconnects from the primary container in their editor. Thedefault is to stop all of the compose containers.
const (ShutdownActionNoneShutdownAction = "none"StopComposeShutdownAction = "stopCompose"StopContainerShutdownAction = "stopContainer")
typeUserEnvProbe¶
type UserEnvProbestring
User environment probe to run. The default is "loginInteractiveShell".
const (InteractiveShellUserEnvProbe = "interactiveShell"LoginInteractiveShellUserEnvProbe = "loginInteractiveShell"LoginShellUserEnvProbe = "loginShell"UserEnvProbeNoneUserEnvProbe = "none")