Description of problem:
Customer is recently moving to Podman api from docker api and there seems to be some functionality missing that seems like it should definitely be available.
Customer was able to bind mount host volumes into the container using the following calls but they do not work with the podman api which they are being pushed to due to the replacement of docker in rhel 8.
curl -XPOST --unix-socket /var/run/docker.sock -H "Content-Type:application/json" -d '{"Image": "nvidia/cuda:9.0-cudnn7-devel-centos7", "Hostconfig": {"Binds": ["/tmp/test/:/tmp/test:rw"]}}' http://localhost/containers/create
curl -XPOST --unix-socket /var/run/docker.sock -H "Content-Type:application/json" -d '{"Image": "nvidia/cuda:9.0-cudnn7-devel-centos7", "Hostconfig": {"Mounts": [ {"Target": "/tmp", "Source": "/tmp/test", "Type": "bind", "ReadOnly": false, "Consistency" : "default"}]}} http://localhost/containers/create
The following command results in a volume mount but they are looking to simply bind mount a host volume inside the container and not create a new podman volume.
Yields a volume mount (based on podman inspect):
curl -XPOST --unix-socket /var/run/docker.sock -H "Content-Type:application/json" -d '{"Image": "nvidia/cuda:9.0-cudnn7-devel-centos7","Volumes" : {"/tmp/test": {}} ,"HostConfig": {"Binds": ["/tmp/test/:/tmp/test:rw"]}}' http://localhost/containers/create
I thought this was simply a compatibility issue with previous docker api calls and using the podman-docker package but I do not see this ability on the podman api reference page:
https://docs.podman.io/en/latest/_static/api.html#tag/
If there is a way to do this that is either not documented or I simply missed that would be great as well.
Version-Release number of selected component (if applicable):
version:
APIVersion: 1
Built: 1600877882
BuiltTime: Wed Sep 23 18:18:02 2020
GitCommit: ""
GoVersion: go1.14.7
OsArch: linux/amd64
Version: 2.0.5
How reproducible:
Every time
Actual results:
Missing functionality
Expected results:
Comparable/compatible commands for this function.
Additional info:
It looks like podman api was forked from the docker api at a specific version we are essentially doingour best to adhere to compatibility but with the amount of differences and changes between the two they are not always going to be directly compatible.
Podman REST API and Docker compatibility
URL: https://podman.io/blogs/2020/07/01/rest-versioning.html
"Podman v2.0.0 launched recently, and with it the REST API. We’ve seen a great deal of excitement with this new API because of what it will enable - enabling applications and automation to use Podman when the could previously only use Docker. As you may know, Podman’s REST API is split into two halves: one providing a Docker-compatible API, and a Libpod API providing support for Podman’s unique features such as pods. We would love for all projects to eventually grow to support for our native Libpod API, but this will take time (and may be impossible for older, no longer maintained projects). As such, we need to talk about the Compatibility API and how it can be used.
**When we developed the compatibility API layer, we targeted the latest released version of the Docker API, v1.40. Within this version, we aimed to implement all endpoints, with the exception of those used for Swarm(1). Podman is not a tool for managing clusters, and does not intend to become one. We recognize that many existing tools do not target this specific Docker API version, and these are occasionally breaking changes in the Docker API that may make using the newest API impossible. The core Podman team cannot commit to being bug-for-bug compatible with every version of the Docker API.** The Podman team commits to fixing bugs related to the latest version of Docker API. We may fix bugs with older versions that affect many users. As a community project, we gladly accept help here - if you find bugs that prevent Podman from working with a specific API version you use and are willing to fix them, we’re always happy to accept patches!"
However I believe that this functionality is basic enough that it should probably be included.
If there is anything else you need from me feel free to reach out or if you need any clarification let me know.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2021:1796