devcontainer
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¶
Index¶
- func ImageFromDockerfile(dockerfileContent string) (name.Reference, error)
- func SubstituteVars(s string, workspaceFolder string, lookupEnv func(string) (string, bool)) string
- func UserFromDockerfile(dockerfileContent string) (user string, err error)
- func UserFromImage(ref name.Reference) (string, error)
- type BuildSpec
- type Compiled
- type LifecycleScript
- type LifecycleScripts
- type Spec
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcImageFromDockerfile¶
ImageFromDockerfile inspects the contents of a provided Dockerfileand returns the image that will be used to run the container.
funcSubstituteVars¶added inv0.2.7
funcUserFromDockerfile¶
UserFromDockerfile inspects the contents of a provided Dockerfileand returns the user that will be used to run the container.
Types¶
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.
typeLifecycleScript¶added inv0.2.4
type LifecycleScript struct {// contains filtered or unexported fields}
func (*LifecycleScript)Execute¶added inv0.2.4
func (s *LifecycleScript) Execute(ctxcontext.Context, uid, gidint)error
func (*LifecycleScript)IsEmpty¶added inv0.2.4
func (s *LifecycleScript) IsEmpty()bool
func (*LifecycleScript)ScriptLines¶added 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)UnmarshalJSON¶added inv0.2.4
func (s *LifecycleScript) UnmarshalJSON(data []byte)error
typeLifecycleScripts¶added 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"`}
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)HasDockerfile¶added inv0.1.5
HasDockerfile returns true if the devcontainer.json specifies the path to aDockerfile.