Documentation
¶
Index ¶
- type Container
- func (c *Container) CopyInto(src, dest string) error
- func (c *Container) DefaultRootfsType() (string, error)
- func (c *Container) ExecArgv() []string
- func (c *Container) InitDNF() error
- func (cnt *Container) NewContainerSolver(cacheRoot string, architecture arch.Arch, sourceInfo *source.Info) (*dnfjson.Solver, error)
- func (c *Container) ReadFile(path string) ([]byte, error)
- func (c *Container) Root() string
- func (c *Container) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a simpler wrapper around a running podman container. This type isn't meant as a general-purpose container management tool, but as an opinonated library for bootc-image-builder.
func New ¶
New creates a new running container from the given image reference.
NB: - --net host is used to make networking work in a nested container - /run/secrets is mounted from the host to make sure RHSM credentials are available
func (*Container) DefaultRootfsType ¶
DefaultRootfsType returns the default rootfs type (e.g. "ext4") as specified by the bootc container install configuration. An empty string is valid and means the container sets no default.
func (*Container) InitDNF ¶
InitDNF initializes dnf in the container. This is necessary when the caller wants to read the image's dnf repositories, but they are not static, but rather configured by dnf dynamically. The primaru use-case for this is RHEL and subscription-manager.
The implementation is simple: We just run plain `dnf` in the container so that the subscription-manager gets initialized. For compatibility with both dnf and dnf5 we cannot just run "dnf" as dnf5 will error and do nothing in this case. So we use "dnf check --duplicates" as this is fast on both dnf4/dnf5 (just doing "dnf5 check" without arguments takes around 25s so that is not a great option).