Uploaded image for project: 'Container Tools'
  1. Container Tools
  2. RUN-3226

[containers/podman] Additional build contexts should be sent as additional tar files

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • rhel-container-tools
    • 8

      [2435748430] Upstream Reporter: Mario Loriedo
      Upstream issue status: Closed
      Upstream description:

      Feature request description

      Option --build-context <label>=<context-path> of the podman build command allows to specify additional build contexts. The podman client doesn't send these additional build contexts as tar files in the current implementation. Only the main build context is sent.

      Since podman doesn't send the build contexts to the remote machine, and only passes its local path as an API parameter, the build usually fails because the context path doesn't exist in the remote machine. It only works in the cases where the build context path is mounted, on the same path, in the remote machine. But in the general case, it doesn't.

      Suggest potential solution

      A reasonable way to resolve the problem is to transfer every additional build context as a tar file. And change the build HTTP request content to be multi-part. However, we should investigate how Docker handles that, as it's not part of the core engine API (additional build contexts are a buildx feature). So, we should look at how a Docker client handles it and work on a compatible solution.

      Have you considered any alternatives?

      On Windows and macOS the problem is mitigated by mounting, in the remote machine, $HOME and other system folders. But if the user overrides the default machine mounts, the machine is in a remote machine etc...the podman build command will still fail.

      Additional context


      Upstream URL: https://github.com/containers/podman/issues/23433

              Unassigned Unassigned
              upstream-sync Upstream Sync
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: