# README
containerapi
Go bindings to manage containers in a runtime agnostic way.
Currently supports:
- Docker
- Podman >= 4.0.0.
Why?
While Podman and Docker API is mostly compatible, we noticed instances where the exact behaviour was slightly different. Having a small set of primitives to cover the most basic container use cases, we can check for divergent behaviour in CI and ensure we offer a consistent API for both.
Development
We use virter
for provisioning development machines.
Run tests
go test ./...
Run podman tests in a VM:
virter vm run --name podman-test --id 101 --provision virter/provision-podman.toml alma-8
virter vm exec --provision virter/exec-test.toml podman-test
Run docker tests in a VM:
virter vm run --name docker-test --id 102 --provision virter/provision-docker.toml alma-8
virter vm exec --provision virter/exec-test.toml docker-test
# Packages
No description provided by the author
# Functions
Set the container name, the image to use, and the environment to pass to the container.
No description provided by the author
No description provided by the author
Returns a new, initialized ContainerProvider of the given provider type.
Returns the list of available providers.
No description provided by the author
No description provided by the author
No description provided by the author
Sets the command to execute in the container.
Sets the DNS search domains to use.
Sets the DNS servers to use.
WithExtraHosts sets additional hosts that should resolve in the container.
Sets the host paths to bind mount in the container.
Configure the pulling behaviour for this container.
# Structs
Configuration passed to the ContainerProvider.Create method.
No description provided by the author
No description provided by the author
Represents a single host path to bind mount in the container.
No description provided by the author
# Interfaces
A ContainerProvider offers basic control over a container lifecycle
For a standard container lifecycle, use the following pattern: 1.