MCPcopy Create free account
hub / github.com/coder/envbuilder / Options

Struct Options

options/options.go:16–185  ·  view source on GitHub ↗

Options contains the configuration for the envbuilder.

Source from the content-addressed store, hash-verified

14
15// Options contains the configuration for the envbuilder.
16type Options struct {
17 // SetupScript is the script to run before the init script. It runs as the
18 // root user regardless of the user specified in the devcontainer.json file.
19 // SetupScript is ran as the root user prior to the init script. It is used to
20 // configure envbuilder dynamically during the runtime. e.g. specifying
21 // whether to start systemd or tiny init for PID 1.
22 SetupScript string
23 // InitScript is the script to run to initialize the workspace.
24 InitScript string
25 // InitCommand is the command to run to initialize the workspace.
26 InitCommand string
27 // InitArgs are the arguments to pass to the init command. They are split
28 // according to /bin/sh rules with https://github.com/kballard/go-shellquote.
29 InitArgs string
30 // CacheRepo is the name of the container registry to push the cache image to.
31 // If this is empty, the cache will not be pushed.
32 CacheRepo string
33 // BaseImageCacheDir is the path to a directory where the base image can be
34 // found. This should be a read-only directory solely mounted for the purpose
35 // of caching the base image.
36 BaseImageCacheDir string
37 // LayerCacheDir is the path to a directory where built layers will be stored.
38 // This spawns an in-memory registry to serve the layers from.
39 LayerCacheDir string
40 // DevcontainerDir is the path to the folder containing the devcontainer.json
41 // file that will be used to build the workspace and can either be an absolute
42 // path or a path relative to the workspace folder. If not provided, defaults
43 // to `.devcontainer`.
44 DevcontainerDir string
45 // DevcontainerJSONPath is a path to a devcontainer.json file
46 // that is either an absolute path or a path relative to
47 // DevcontainerDir. This can be used in cases where one wants
48 // to substitute an edited devcontainer.json file for the one
49 // that exists in the repo.
50 // If neither `DevcontainerDir` nor `DevcontainerJSONPath` is provided,
51 // envbuilder will browse following directories to locate it:
52 // 1. `.devcontainer/devcontainer.json`
53 // 2. `.devcontainer.json`
54 // 3. `.devcontainer/<folder>/devcontainer.json`
55 DevcontainerJSONPath string
56 // DockerfilePath is the relative path to the Dockerfile that will be used to
57 // build the workspace. This is an alternative to using a devcontainer that
58 // some might find simpler.
59 DockerfilePath string
60 // BuildContextPath can be specified when a DockerfilePath is specified
61 // outside the base WorkspaceFolder. This path MUST be relative to the
62 // WorkspaceFolder path into which the repo is cloned.
63 BuildContextPath string
64 // CacheTTLDays is the number of days to use cached layers before expiring
65 // them. Defaults to 7 days.
66 CacheTTLDays int64
67 // DockerConfigBase64 is the base64 encoded Docker config file that will be
68 // used to pull images from private container registries.
69 DockerConfigBase64 string
70 // FallbackImage specifies an alternative image to use when neither an image
71 // is declared in the devcontainer.json file nor a Dockerfile is present. If
72 // there's a build failure (from a faulty Dockerfile) or a misconfiguration,
73 // this image will be the substitute. Set ExitOnBuildFailure to true to halt

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected