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 not create a container from oci-archive via http api #8927

Closed
towe75 opened this issue Jan 10, 2021 · 4 comments
Closed

Can not create a container from oci-archive via http api #8927

towe75 opened this issue Jan 10, 2021 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@towe75
Copy link
Contributor

towe75 commented Jan 10, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I'm not able to use the http api to create a container backed by a oci-archive.
This was possible with the older, varling based, api.

Steps to reproduce the issue:

  1. Create a oci-archive file.
podman pull docker://docker.io/library/busybox:latest
podman push busbox:latest oci-archive:/tmp/busybox.oci
  1. Try to create a container
curl -d '{"image":"oci-archive:/tmp/busybox.oci"}' -H "Content-Type: application/json" --unix-socket /run/podman/podman.sock http://localhost/v1.24/libpod/containers/create

{"cause":"invalid reference format","message":"invalid reference format","response":500}
  1. Using a regular image works like expected
curl -d '{"image":"docker://busybox:latest"}' -H "Content-Type: application/json" --unix-socket /run/podman/podman.sock http://localhost/v1.24/libpod/containers/create    

{"Id":"0389ef309949311f6a9828d759a8e90241c59655215f423b8c45a1c6b3d2447c","Warnings":[]} 

Describe the results you received:

I've got a "invalid reference format" error.

Additional information you deem important (e.g. issue happens only occasionally):

This is related to hashicorp/nomad-driver-podman#69

Output of podman version:

Version:      2.2.1
API Version:  2.1.0
Go Version:   go1.14.10
Built:        Tue Dec  8 15:37:43 2020
OS/Arch:      linux/amd64
@mheon
Copy link
Member

mheon commented Jan 11, 2021

@vrothberg I believe this was disabled intentionally? Is there a recommended alternative (e.g. doing a manual load on the image first?)

@vrothberg
Copy link
Member

That's right. Only the docker:// transport and local images are supported for create. In case of an oci-archive, we first need to load it and can then create and run containers.

@towe75
Copy link
Contributor Author

towe75 commented Jan 15, 2021

@vrothberg : please explain how this should work. AFAIK the image/load api is supposed to upload a image from some http client to the podman server. But the older, varlink based, create call expected a oci-archive directly on the podman node. That is quite some difference and has a huge impact on both performance and storage io.

Also in the context of our nomad plugin: each spawned task would again have to load the same image because we can not tell if it was imported before. There is no way to get image name and tags from the oci-archive via podman etc.

Is there some other alternative?

@vrothberg
Copy link
Member

@towe75, that's right. A client would have to upload the oci-archive, and then we can use the previously loaded image to create and run containers.

I don't think that the archive has to be uploaded each and every time. We can check the presence of an image via the libpod/images/$nameOrID/exists endpoint. Assuming the image in the oci-archive has a known name/tag, you can first check if it's present, upload if needed and then continue creating/running containers.

Would that work for you?

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants