Documentation
¶
Index ¶
- Constants
- func BuildPackageList(version, pkgVersion, cliPkgVersion string, extraPkgs ...string) string
- func Install(ctx context.Context, stdout, stderr io.Writer) (string, error)
- type DebianInstaller
- type Detector
- type Distro
- type Executor
- func (e *Executor) Run(ctx context.Context, shC, cmdStr string) error
- func (e *Executor) RunCommands(ctx context.Context, shC string, cmds []string) error
- func (e *Executor) RunCommandsWithRetry(ctx context.Context, shC string, cmds []string, timeout time.Duration) error
- func (e *Executor) RunWithRetry(ctx context.Context, shC, cmdStr string, timeout time.Duration) error
- type InstallOptions
- type Installer
- type Validator
Constants ¶
View Source
const ( // Channels. ChannelStable = "stable" // Timeouts. DefaultTimeout = 5 * time.Minute ExistingDockerDelay = 20 * time.Second WSLWarningDelay = 20 * time.Second DeprecationDelay = 10 * time.Second RetryDelay = 10 * time.Second // Apt options. AptTimeoutSeconds = 30 AptRetries = 3 // Paths. DefaultDownloadURL = "https://download.docker.com" DefaultRepoFile = "docker-ce.repo" // Docker paths. DockerBinPath1 = "/usr/bin/docker" DockerBinPath2 = "/usr/local/bin/docker" DockerBinPath3 = "/bin/docker" DockerSocket = "/var/run/docker.sock" // Files. OSReleaseFile = "/etc/os-release" ProcVersionFile = "/proc/version" DebianVersion = "/etc/debian_version" // Package names. PkgDockerCE = "docker-ce" PkgDockerCECLI = "docker-ce-cli" PkgContainerd = "containerd.io" PkgDockerCompose = "docker-compose-plugin" PkgDockerBuildx = "docker-buildx-plugin" PkgDockerScan = "docker-scan-plugin" PkgDockerRootlessExtras = "docker-ce-rootless-extras" // Shell commands. ShellEcho = "echo" // Distro names. DistroUbuntu = "ubuntu" DistroRaspbian = "raspbian" DistroOSMC = "osmc" DistroDebian = "debian" // Debian release codenames. CodenameTrixie = "trixie" CodenameBookworm = "bookworm" CodenameBullseye = "bullseye" CodenameBuster = "buster" CodenameStretch = "stretch" CodenameJessie = "jessie" )
Variables ¶
This section is empty.
Functions ¶
func BuildPackageList ¶
Types ¶
type DebianInstaller ¶
type DebianInstaller struct {
// contains filtered or unexported fields
}
func NewDebianInstaller ¶
func NewDebianInstaller(distro *Distro, opts *InstallOptions) *DebianInstaller
type Detector ¶
type Detector struct{}
func NewDetector ¶
func NewDetector() *Detector
func (*Detector) CheckForked ¶
func (*Detector) DetectDistro ¶
type Distro ¶
Distro represents a Linux distribution. ID is the distribution identifier (e.g., "ubuntu", "debian", "fedora"). Version should be a codename (e.g., "jammy", "bookworm") for Debian-based distros, or a version number (e.g., "39") for others like Fedora.
func (*Distro) HasCodename ¶
HasCodename returns true if Version is a valid codename (non-numeric).
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor(opts *InstallOptions) *Executor
func (*Executor) RunCommands ¶
func (*Executor) RunCommandsWithRetry ¶
type InstallOptions ¶
type InstallOptions struct {
// contains filtered or unexported fields
}
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator(opts *InstallOptions) *Validator
func (*Validator) CheckDeprecation ¶
func (*Validator) CheckExistingDocker ¶
func (v *Validator) CheckExistingDocker()
func (*Validator) ValidateDistro ¶
func (*Validator) ValidateOS ¶
Click to show internal directories.
Click to hide internal directories.