Movatterモバイル変換


[0]ホーム

URL:


options

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:13Imported by:0

Details

Repository

github.com/coder/envbuilder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcDefaultWorkspaceFolder

func DefaultWorkspaceFolder(workspacesFolder, repoURLstring)string

DefaultWorkspaceFolder returns the default workspace folderfor a given repository URL.

funcUnsetEnv

func UnsetEnv()

UnsetEnv unsets all environment variables that are usedto configure the options.

funcWithEnvPrefix

func WithEnvPrefix(strstring)string

Types

typeOptions

type Options struct {// SetupScript is the script to run before the init script. It runs as the// root user regardless of the user specified in the devcontainer.json file.// SetupScript is ran as the root user prior to the init script. It is used to// configure envbuilder dynamically during the runtime. e.g. specifying// whether to start systemd or tiny init for PID 1.SetupScriptstring// InitScript is the script to run to initialize the workspace.InitScriptstring// InitCommand is the command to run to initialize the workspace.InitCommandstring// InitArgs are the arguments to pass to the init command. They are split// according to /bin/sh rules withhttps://github.com/kballard/go-shellquote.InitArgsstring// CacheRepo is the name of the container registry to push the cache image to.// If this is empty, the cache will not be pushed.CacheRepostring// BaseImageCacheDir is the path to a directory where the base image can be// found. This should be a read-only directory solely mounted for the purpose// of caching the base image.BaseImageCacheDirstring// LayerCacheDir is the path to a directory where built layers will be stored.// This spawns an in-memory registry to serve the layers from.LayerCacheDirstring// DevcontainerDir is the path to the folder containing the devcontainer.json// file that will be used to build the workspace and can either be an absolute// path or a path relative to the workspace folder. If not provided, defaults// to `.devcontainer`.DevcontainerDirstring// DevcontainerJSONPath is a path to a devcontainer.json file// that is either an absolute path or a path relative to// DevcontainerDir. This can be used in cases where one wants// to substitute an edited devcontainer.json file for the one// that exists in the repo.// If neither `DevcontainerDir` nor `DevcontainerJSONPath` is provided,// envbuilder will browse following directories to locate it:// 1. `.devcontainer/devcontainer.json`// 2. `.devcontainer.json`// 3. `.devcontainer/<folder>/devcontainer.json`DevcontainerJSONPathstring// DockerfilePath is the relative path to the Dockerfile that will be used to// build the workspace. This is an alternative to using a devcontainer that// some might find simpler.DockerfilePathstring// BuildContextPath can be specified when a DockerfilePath is specified// outside the base WorkspaceFolder. This path MUST be relative to the// WorkspaceFolder path into which the repo is cloned.BuildContextPathstring// CacheTTLDays is the number of days to use cached layers before expiring// them. Defaults to 7 days.CacheTTLDaysint64// DockerConfigBase64 is the base64 encoded Docker config file that will be// used to pull images from private container registries.DockerConfigBase64string// FallbackImage specifies an alternative image to use when neither an image// is declared in the devcontainer.json file nor a Dockerfile is present. If// there's a build failure (from a faulty Dockerfile) or a misconfiguration,// this image will be the substitute. Set ExitOnBuildFailure to true to halt// the container if the build faces an issue.FallbackImagestring// ExitOnBuildFailure terminates the container upon a build failure. This is// handy when preferring the FALLBACK_IMAGE in cases where no// devcontainer.json or image is provided. However, it ensures that the// container stops if the build process encounters an error.ExitOnBuildFailurebool// ExitOnPushFailure terminates the container upon a push failure. This is// useful if failure to push the built image should abort execution// and result in an error.ExitOnPushFailurebool// ForceSafe ignores any filesystem safety checks. This could cause serious// harm to your system! This is used in cases where bypass is needed to// unblock customers.ForceSafebool// Insecure bypasses TLS verification when cloning and pulling from container// registries.Insecurebool// IgnorePaths is the comma separated list of paths to ignore when building// the workspace.IgnorePaths []string// BuildSecrets is the list of secret environment variables to use when// building the image.BuildSecrets []string// SkipRebuild skips building if the MagicFile exists. This is used to skip// building when a container is restarting. e.g. docker stop -> docker start// This value can always be set to true - even if the container is being// started for the first time.SkipRebuildbool// GitURL is the URL of the Git repository to clone. This is optional.GitURLstring// GitCloneDepth is the depth to use when cloning the Git repository.GitCloneDepthint64// GitCloneSingleBranch clone only a single branch of the Git repository.GitCloneSingleBranchbool// GitUsername is the username to use for Git authentication. This is// optional.GitUsernamestring// GitPassword is the password to use for Git authentication. This is// optional.GitPasswordstring// GitSSHPrivateKeyPath is the path to an SSH private key to be used for// Git authentication.GitSSHPrivateKeyPathstring// GitSSHPrivateKeyBase64 is the content of an SSH private key to be used// for Git authentication.GitSSHPrivateKeyBase64string// GitHTTPProxyURL is the URL for the HTTP proxy. This is optional.GitHTTPProxyURLstring// WorkspaceBaseDir is the path under which workspaces will be placed when// workspace folder option is not given.WorkspaceBaseDirstring// WorkspaceFolder is the path to the workspace folder that will be built.// This is optional. Defaults to `[workspace base dir]/[name]` where name is// the name of the repository or "empty".WorkspaceFolderstring// SSLCertBase64 is the content of an SSL cert file. This is useful for// self-signed certificates.SSLCertBase64string// ExportEnvFile is the optional file path to a .env file where envbuilder// will dump environment variables from devcontainer.json and the built// container image.ExportEnvFilestring// PostStartScriptPath is the path to a script that will be created by// envbuilder based on the postStartCommand in devcontainer.json, if any is// specified (otherwise the script is not created). If this is set, the// specified InitCommand should check for the presence of this script and// execute it after successful startup.PostStartScriptPathstring// Logger is the logger to use for all operations.Loggerlog.Func// Verbose controls whether to send verbose logs.Verbosebool// Filesystem is the filesystem to use for all operations. Defaults to the// host filesystem.Filesystem billy.Filesystem// These options are specifically used when envbuilder is invoked as part of a// Coder workspace.// Revert to `*url.URL` oncehttps://github.com/coder/serpent/issues/14 is fixed.CoderAgentURLstring// CoderAgentToken is the authentication token for a Coder agent.CoderAgentTokenstring// CoderAgentSubsystem is the Coder agent subsystems to report when forwarding// logs. The envbuilder subsystem is always included.CoderAgentSubsystem []string// PushImage is a flag to determine if the image should be pushed to the// container registry. This option implies reproducible builds.PushImagebool// GetCachedImage is a flag to determine if the cached image is available,// and if it is, to return it.GetCachedImagebool// RemoteRepoBuildMode uses the remote repository as the source of truth// when building the image. Enabling this option ignores user changes to// local files and they will not be reflected in the image. This can be// used to improving cache utilization when multiple users are building// working on the same repository.RemoteRepoBuildModebool// BinaryPath is the path to the local envbuilder binary when// attempting to probe the build cache. This is only relevant when// GetCachedImage is true.BinaryPathstring// WorkingDirBase is the path to the directory where all envbuilder files should be// stored. By default, this is set to `/.envbuilder`. This is intentionally// excluded from the CLI options.WorkingDirBasestring}

Options contains the configuration for the envbuilder.

func (*Options)CABundle

func (o *Options) CABundle() ([]byte,error)

func (*Options)CLI

func (o *Options) CLI()serpent.OptionSet

Generate CLI options for the envbuilder command.

func (*Options)Markdown

func (o *Options) Markdown()string

func (*Options)SetDefaults

func (o *Options) SetDefaults()

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