Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyRootOwned ¶ added in v0.19.2
VerifyRootOwned checks that an extracted rootfs really is owned by uid 0.
Extraction runs `sudo tar`/`umoci` and faithfully preserves whatever UIDs the archive carries. If the pull ran inside a nested user namespace — a rootless container, `podman unshare`, distrobox/toolbox, a sandboxed shell — then "root" in that namespace is the invoking host user, and every container-root file lands owned by that user instead of 0. Nothing later in provisioning notices: the container still boots, but `sudo` inside it is broken (`/usr/bin/sudo must be owned by uid 0`), and since the container runs without --private-users, container root IS host root — so the host user can write code that later executes as real root.
Fail loudly here rather than hand back a silently poisoned rootfs.
Types ¶
type DockerPuller ¶
type DockerPuller struct {
// contains filtered or unexported fields
}
DockerPuller pulls and extracts using docker.
func NewDockerPuller ¶ added in v0.16.0
func NewDockerPuller() *DockerPuller
type PodmanPuller ¶
type PodmanPuller struct {
// contains filtered or unexported fields
}
PodmanPuller pulls and extracts using podman. For locally-built images (localhost/ prefix) it uses --policy=missing so podman doesn't try to reach a registry that doesn't exist.
func NewPodmanPuller ¶ added in v0.16.0
func NewPodmanPuller() *PodmanPuller
type Puller ¶
type Puller interface {
// Name returns a human-readable name for the backend (e.g. "podman").
Name() string
// PullAndExtract pulls image from a registry and extracts it to rootfsPath.
// tmpDir overrides the directory used for intermediate files (e.g. exported
// tars). When empty, os.TempDir() is used.
PullAndExtract(r runner.Runner, image string, rootfsPath string, tmpDir string) error
}
Puller pulls a container image from a registry and extracts it to a rootfs directory.
type SkopeoPuller ¶
type SkopeoPuller struct{}
SkopeoPuller pulls and extracts using skopeo + umoci.
func (*SkopeoPuller) Name ¶
func (p *SkopeoPuller) Name() string