Movatterモバイル変換


[0]ホーム

URL:


dcspec

package
v2.23.0Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:3Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Overview

Package dcspec contains an automatically generated Devcontainerspecification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeAppPortElement

type AppPortElement struct {Integer *int64String  *string}

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)MarshalJSONadded inv2.22.0

func (x *AppPortElement) MarshalJSON() ([]byte,error)

func (*AppPortElement)UnmarshalJSONadded 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

type CacheFrom struct {String      *stringStringArray []string}

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)MarshalJSONadded inv2.22.0

func (x *CacheFrom) MarshalJSON() ([]byte,error)

func (*CacheFrom)UnmarshalJSONadded inv2.22.0

func (x *CacheFrom) UnmarshalJSON(data []byte)error

typeCommand

type Command struct {String      *stringStringArray []stringUnionMap    map[string]*CacheFrom}

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)MarshalJSONadded inv2.22.0

func (x *Command) MarshalJSON() ([]byte,error)

func (*Command)UnmarshalJSONadded inv2.22.0

func (x *Command) UnmarshalJSON(data []byte)error

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

funcUnmarshalDevContaineradded inv2.22.0

func UnmarshalDevContainer(data []byte) (DevContainer,error)

func (*DevContainer)Marshaladded 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)MarshalJSONadded inv2.22.0

func (x *DevContainerAppPort) MarshalJSON() ([]byte,error)

func (*DevContainerAppPort)UnmarshalJSONadded 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

type ForwardPort struct {Integer *int64String  *string}

func (*ForwardPort)MarshalJSONadded inv2.22.0

func (x *ForwardPort) MarshalJSON() ([]byte,error)

func (*ForwardPort)UnmarshalJSONadded 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.

typeGPUEnum

type GPUEnumstring
const (OptionalGPUEnum = "optional")

typeGPUUnion

type GPUUnion struct {Bool     *boolEnum     *GPUEnumGPUClass *GPUClass}

func (*GPUUnion)MarshalJSONadded inv2.22.0

func (x *GPUUnion) MarshalJSON() ([]byte,error)

func (*GPUUnion)UnmarshalJSONadded inv2.22.0

func (x *GPUUnion) UnmarshalJSON(data []byte)error

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.

typeMount

type Mount struct {// Mount source.Source *string `json:"source,omitempty"`// Mount target.Targetstring `json:"target"`// Mount type.TypeType `json:"type"`}

typeMountElement

type MountElement struct {Mount  *MountString *string}

func (*MountElement)MarshalJSONadded inv2.22.0

func (x *MountElement) MarshalJSON() ([]byte,error)

func (*MountElement)UnmarshalJSONadded 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{}

typeProtocol

type Protocolstring

The protocol to use when forwarding this port.

const (HTTPProtocol = "http"HTTPSProtocol = "https")

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")

typeType

type Typestring

Mount type.

const (BindType = "bind"VolumeType = "volume")

typeUserEnvProbe

type UserEnvProbestring

User environment probe to run. The default is "loginInteractiveShell".

const (InteractiveShellUserEnvProbe = "interactiveShell"LoginInteractiveShellUserEnvProbe = "loginInteractiveShell"LoginShellUserEnvProbe = "loginShell"UserEnvProbeNoneUserEnvProbe = "none")

typeWaitFor

type WaitForstring

The user command to wait for before continuing execution in the background while the UIis starting up. The default is "updateContentCommand".

const (InitializeCommandWaitFor = "initializeCommand"OnCreateCommandWaitFor = "onCreateCommand"PostCreateCommandWaitFor = "postCreateCommand"PostStartCommandWaitFor = "postStartCommand"UpdateContentCommandWaitFor = "updateContentCommand")

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp