Seekable OCI and Docker Engine v24 #949
Replies: 2 comments
-
We just ran into the |
Beta Was this translation helpful? Give feedback.
-
The workflow seen with Docker v24 which builds and pushes a Docker image without needing to rely on
Unfortunately changing the Docker image store to containerd and then restarting Docker engine isn't currently possible in Codebuild using the standard AL2 Codebuild images (AWS support ticket 13316810401). So when Codebuild eventually gains support for Docker v24, hopefully it also gains support for using the containerd image store and restarting Docker. |
Beta Was this translation helpful? Give feedback.
-
In Docker Engine v24 (Rel Notes) they announced experimental support for the containerd content store, unblocking the ability to use the soci snapshotter with the Docker Engine. Below you can see my findings on using the soci-snapshotter with the Docker Engine both from a building and a running perspective.
Test Environment
These tests were carried out on Amazon Linux 2023 as it provides a package for Docker Engine v24.
Indexing a Container Image built with Docker Build
Traditionally you have been unable to generate SOCI Indexes for container images built by
docker build
because:soci
CLI only indexes container image stored in the containerd content store (snapshotters)docker build
stores container images in the docker engine image store (graph drivers).But with Docker Engine v24, the second point is not longer accurate when using the experimental containerd content store support.
Prerequisites
soci
CLI, we don’t actually need to configure thesoci-snapshotter
and it does not need to be running to generate SOCI indexes.Build a container image
Next we can build some container images with
docker build
and a local Dockerfile.Create the SOCI index
Now we can use the
soci
CLI to index our container imagePush things up to the registry
docker
commands, you may need to set the credential location (DOCKER_CONFIG
) to the users credential file. The SOCI CLI by default looks in/root/.docker
.Bugs
soci
CLI is unable to find the image reference if the container image is not in the default containerd namespace.Lazy Loading Images
In this section we are going to lazy load container images using Docker Engine v24 and the SOCI Snapshotter.
Prerequisites
Lazy Load your container images
The assumption here is that you already have a container image that has been Indexed in a container image repository and that the container image you are attempting to lazy load does not exist locally. (If you have just built the container image using the first part of this post then you may need to remove the container image and the SOCI index from the local content stores).
You’ll notice a few things are still reported as “Download Complete” rather then being lazy loaded (your shas will be different) but this was expected. The objects downloaded in full were:
8a504b2c060d
- Container Image Manifestf2a03a7dcea0
- Container Image Config6e3be4974edb
- Container Image Manifest List / Image Index (this may not be there in your example, it depends on how the container image was built).Bugs
stargz-snapshotter
with the Docker Engine v24. I’m unsure if this is an upstream Moby bug or a SOCI Snapshotter bug but the easy workaround is to create the directory manuallysudo mkdir -p /var/lib/docker/rootfs/soci
Beta Was this translation helpful? Give feedback.
All reactions