What is /var/lib/containers used for when deploing OCI

Problem:
Tried following docs at Multi-Process Images - Pulp Project to setup Pulp in a container

The docs tell me to create a mount for /var/lib/containers, but I am confused what part of Pulp is using it.
I was expecting all pulp data to be in /var/lib/pulp (and /etc/pulp, for configs).

Expected outcome:
No confusion :slight_smile:

Pulpcore version:
Irrelevant

Pulp plugins installed and their versions:
Irrelevant

Operating system - distribution and version:
Irrelevant

Other relevant data:

I found this in other section:

We do not bother to move /var/lib/containers because it is only ever used for temporary files by pulp_container, and may be used on the host for other purposes (like running podman).

Maybe this could be further clarified? or its just about finding this info?

Having that info on the Multi-Process Images - Pulp Project would be cool, yeah.

But then, looking further, Single-Process Images - Pulp Project doesn’t mention those paths at all?

What happens if /var/lib/containers doesn’t exist when pulp_container is used? Katello deployments don’t have that folder, for example.

The /var/lib/containers path is not directly used by pulp_container. In rootless environments, it seems like the nested podman can have permission errors: Nested container image builds and pushes are failing to start · Issue #540 · pulp/pulp-oci-images · GitHub.

pulp_container uses /var/lib/pulp/tmp/<pid>@<worker>/ as a temporary area (to keep cached layers, build context files, etc.) for the build machinery. This build process runs a podman build, and podman (not Pulp) may need access to /var/lib/containers/storage (graphroot), which can cause errors.

3 Likes

@hyagi but why would podman/buildah/skopeo be executed inside the running pulp container (besides CI which might prepare containers to push or something)?

reads further

oooh, you can upload a containerfile and pulp_container will build it FOR us? TIL!

4 Likes

oooh, you can upload a containerfile and pulp_container will build it FOR us?

Yep! It is still in tech preview, but you can upload the Containerfile in the build request:

http --form POST ${BASE_ADDR}${CONTAINER_REPO}'build_image/' "containerfile@./Containerfile" 
build_context=${FILE_REPO}versions/1/

or, if the Containerfile is already stored in pulp_file, you just need to pass its name (with the file repository_version):

http --form POST ${BASE_ADDR}${CONTAINER_REPO}'build_image/' containerfile_name=MyContainerfile build_context=${FILE_REPO}versions/2/

and pulp_container will build (using podman build) the container image.

3 Likes