Container
bx2cloud implements primitive container runtime functionality through its container
resource.
A user is able to create a container based on any image from an OCI compliant registry (e.g. Docker Hub, quay.io) and control the container's lifecycle (start, stop). During creation, a container resource must be attached to a subnetwork resource and an arbitrary IP from the subnetwork's IP range is allocated. Container state is stored in /var/run/bx2cloud
and rootfs'es are stored in /var/lib/bx2cloud
.
info
As of now, there is no caching of image layers and each new container receives it's own completely separate rootfs. Future work should add support for OverlayFS.
warning
Registry authentication with credentials (private registries) is not supported as of now.
Creating a container
- CLI
- Terraform
bx2cloud container create examples/api/container/create-ubuntu.yaml
examples/api/container/create-ubuntu.yaml
subnetworkId: 4
image: ubuntu:24.04
cmd:
- /bin/sleep
- infinity
resource "bx2cloud_container" "my_container" {
subnetwork_id = bx2cloud_subnetwork.my_subnetwork.id
image = "ubuntu:24.04"
cmd = ["/bin/sleep", "infinity"]
status = "running"
}