Movatterモバイル変換


[0]ホーム

URL:


devcontainer

package
v1.1.0Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License:Apache-2.0Imports:22Imported by:0

Details

Repository

github.com/coder/envbuilder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcImageFromDockerfile

func ImageFromDockerfile(dockerfileContentstring) (name.Reference,error)

ImageFromDockerfile inspects the contents of a provided Dockerfileand returns the image that will be used to run the container.

funcSubstituteVarsadded inv0.2.7

func SubstituteVars(sstring, workspaceFolderstring, lookupEnv func(string) (string,bool))string

funcUserFromDockerfile

func UserFromDockerfile(dockerfileContentstring) (userstring, errerror)

UserFromDockerfile inspects the contents of a provided Dockerfileand returns the user that will be used to run the container.

funcUserFromImage

func UserFromImage(refname.Reference) (string,error)

UserFromImage inspects the remote reference and returns the userthat will be used to run the container.

Types

typeBuildSpec

type BuildSpec struct {Dockerfilestring            `json:"dockerfile"`Contextstring            `json:"context"`Args       map[string]string `json:"args"`Targetstring            `json:"target"`CacheFromstring            `json:"cache_from"`}

typeCompiled

type Compiled struct {DockerfilePathstringDockerfileContentstringBuildContextstringFeatureContexts   map[string]stringBuildArgs         []stringUserstringContainerEnv map[string]stringRemoteEnv    map[string]string}

Compiled is the result of compiling a devcontainer.json file.

typeLifecycleScriptadded inv0.2.4

type LifecycleScript struct {// contains filtered or unexported fields}

func (*LifecycleScript)Executeadded inv0.2.4

func (s *LifecycleScript) Execute(ctxcontext.Context, uid, gidint)error

func (*LifecycleScript)IsEmptyadded inv0.2.4

func (s *LifecycleScript) IsEmpty()bool

func (*LifecycleScript)ScriptLinesadded inv0.2.4

func (s *LifecycleScript) ScriptLines()string

ScriptLines returns shell syntax for executing the commands in theLifecycleScript.

TODO: Technically the commands could be executed in parallel, but that wouldadd a bit of complexity to do portably.

func (*LifecycleScript)UnmarshalJSONadded inv0.2.4

func (s *LifecycleScript) UnmarshalJSON(data []byte)error

typeLifecycleScriptsadded inv0.2.4

type LifecycleScripts struct {OnCreateCommandLifecycleScript `json:"onCreateCommand"`UpdateContentCommandLifecycleScript `json:"updateContentCommand"`PostCreateCommandLifecycleScript `json:"postCreateCommand"`PostStartCommandLifecycleScript `json:"postStartCommand"`}

typeSpec

type Spec struct {Imagestring            `json:"image"`BuildBuildSpec         `json:"build"`RemoteUserstring            `json:"remoteUser"`ContainerUserstring            `json:"containerUser"`ContainerEnv  map[string]string `json:"containerEnv"`RemoteEnv     map[string]string `json:"remoteEnv"`// Features is a map of feature names to feature configurations.Features map[string]any `json:"features"`LifecycleScripts// Deprecated but still frequently used...Dockerfilestring `json:"dockerFile"`Contextstring `json:"context"`}

funcParse

func Parse(content []byte) (*Spec,error)

Parse parses a devcontainer.json file.

func (*Spec)Compile

func (s *Spec) Compile(fs billy.Filesystem, devcontainerDir, scratchDirstring, fallbackDockerfile, workspaceFolderstring, useBuildContextsbool, lookupEnv func(string) (string,bool)) (*Compiled,error)

Compile returns the build parameters for the workspace.devcontainerDir is the path to the directory where the devcontainer.json fileis located. scratchDir is the path to the directory where the Dockerfile willbe written to if one doesn't exist.

func (Spec)HasDockerfileadded inv0.1.5

func (sSpec) HasDockerfile()bool

HasDockerfile returns true if the devcontainer.json specifies the path to aDockerfile.

func (Spec)HasImageadded inv0.1.5

func (sSpec) HasImage()bool

HasImage returns true if the devcontainer.json specifies an image.

Source Files

View all Source files

Directories

PathSynopsis

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