Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use relative paths with the oci-archive transport #389

Open
katiekloss opened this issue Nov 25, 2024 · 0 comments
Open

Can't use relative paths with the oci-archive transport #389

katiekloss opened this issue Nov 25, 2024 · 0 comments

Comments

@katiekloss
Copy link

I have a task which launches a container from an OCI image stored locally, rather than from a container registry. A prestart exec task transfers the image into alloc/tmp/katc.tar, and then the Podman task is configured like this:

config {
  image = "oci-archive:alloc/tmp/katc.tar"
  args = ["nc_rabbit.py"]
}

The task driver returns the following error from Podman:

rpc error: code = Unknown desc = failed to create image: oci-archive:alloc/tmp/katc.tar: invalid image reference oci-archive:alloc/tmp/katc.tar: lstat /alloc: no such file or directory

If I change the image path to use the alloc's absolute path on the Nomad client:

config {
  image = "oci-archive:/opt/nomad/data/alloc/${NOMAD_ALLOC_ID}/alloc/tmp/katc.tar"
  args = ["nc_rabbit.py"]
}

It then works.

Since the driver is just calling the Podman API, I'm assuming this is simply because Podman is interpreting the path as relative to its own working directory (which I'm guessing is just /, from the error).

As a user, I was expecting the driver to accept a path relative to the alloc or task directory, like most other Nomad tasks do. Is it possible for the driver to provide Podman with the absolute path on its own?

I'm using rootful Podman, if that matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant