dockerinstall

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

	// 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"
)

Variables

This section is empty.

Functions

func BuildPackageList added in v0.11.2

func BuildPackageList(version, pkgVersion, cliPkgVersion string, extraPkgs ...string) string

func Install

func Install(stdout, stderr io.Writer) (string, error)

Types

type DebianInstaller added in v0.11.2

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

func NewDebianInstaller added in v0.11.2

func NewDebianInstaller(distro *Distro, opts *InstallOptions) *DebianInstaller

func (*DebianInstaller) Install added in v0.11.2

func (i *DebianInstaller) Install(shC string) error

type Detector added in v0.11.2

type Detector struct{}

func NewDetector added in v0.11.2

func NewDetector() *Detector

func (*Detector) CheckForked added in v0.11.2

func (d *Detector) CheckForked(distro *Distro) *Distro

func (*Detector) DetectDistro added in v0.11.2

func (d *Detector) DetectDistro() *Distro

func (*Detector) DetectOS added in v0.11.2

func (d *Detector) DetectOS() string

func (*Detector) IsWSL added in v0.11.2

func (d *Detector) IsWSL() bool

type Distro added in v0.11.2

type Distro struct {
	ID      string
	Version string
}

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 added in v0.11.2

func (d *Distro) HasCodename() bool

HasCodename returns true if Version is a valid codename (non-numeric).

type Executor added in v0.11.2

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

func NewExecutor added in v0.11.2

func NewExecutor(opts *InstallOptions) *Executor

func (*Executor) Run added in v0.11.2

func (e *Executor) Run(shC, cmdStr string) error

func (*Executor) RunCommands added in v0.11.2

func (e *Executor) RunCommands(shC string, cmds []string) error

func (*Executor) RunCommandsWithRetry added in v0.11.2

func (e *Executor) RunCommandsWithRetry(shC string, cmds []string, timeout time.Duration) error

func (*Executor) RunWithRetry added in v0.11.2

func (e *Executor) RunWithRetry(shC, cmdStr string, timeout time.Duration) error

type InstallOptions added in v0.11.2

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

type Installer added in v0.11.2

type Installer interface {
	Install(shC string) error
}

type Validator added in v0.11.2

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

func NewValidator added in v0.11.2

func NewValidator(opts *InstallOptions) *Validator

func (*Validator) CheckDeprecation added in v0.11.2

func (v *Validator) CheckDeprecation(distro *Distro)

func (*Validator) CheckExistingDocker added in v0.11.2

func (v *Validator) CheckExistingDocker()

func (*Validator) CheckWSL added in v0.11.2

func (v *Validator) CheckWSL(isWSL bool)

func (*Validator) ValidateDistro added in v0.11.2

func (v *Validator) ValidateDistro(distro *Distro) error

func (*Validator) ValidateOS added in v0.11.2

func (v *Validator) ValidateOS(os string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL