Documentation
¶
Overview ¶
Package selfupdate implements `dockercmd --self-upgrade`: download the latest GitHub release asset for this OS/arch, verify its SHA-256 and atomically replace the running executable.
Self-update executes downloaded code, so the checksum check is mandatory: the binary is only swapped in once its SHA-256 matches the digest GitHub records for the asset. The download lands in the target directory (same filesystem) so the final swap is an atomic rename.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUpToDate = errors.New("already up to date")
ErrUpToDate is returned by Apply when the running version is already current.
Functions ¶
Types ¶
type Result ¶ added in v1.5.0
type Result struct {
From string `json:"from"` // version before the upgrade
To string `json:"to"` // version now staged on disk
Asset string `json:"asset"` // release asset that was installed
SHA256 string `json:"sha256"` // verified checksum of the new binary
}
Result describes a completed upgrade.
Click to show internal directories.
Click to hide internal directories.