RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1924146 - RFE Bind mounting host volume using Podman REST API
Summary: RFE Bind mounting host volume using Podman REST API
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Brent Baude
QA Contact: Edward Shen
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1823899
TreeView+ depends on / blocked
 
Reported: 2021-02-02 17:16 UTC by Devon
Modified: 2022-09-21 07:00 UTC (History)
10 users (show)

Fixed In Version: podman-3.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:34:30 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Devon 2021-02-02 17:16:08 UTC
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.

Comment 2 Daniel Walsh 2021-02-09 19:04:04 UTC
This should be fixed in podman 3.0

Comment 10 Daniel Walsh 2021-02-11 21:42:55 UTC
SGTM

Comment 17 errata-xmlrpc 2021-05-18 15:34:30 UTC
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


Note You need to log in before you can comment on or make changes to this bug.