podman icon indicating copy to clipboard operation
podman copied to clipboard

Convert additional build context paths on Windows

Open l0rd opened this issue 1 year ago • 6 comments
trafficstars

This PR partially fixes issues with the option --build-context <label>=<path> of podman build.

This is enough to fix https://github.com/containers/podman/issues/17313 on macOS and Windows WSL with the default machine mounts.

A complete fix of the option --build-context would require packaging the additional build contexts in some additional tars and update the /libpod/build endpoint to accept multi-part HTTP requests. But that's outside the scope of this PR.

Does this PR introduce a user-facing change?

Fix VisualStudio Dev Containers Features on Windows

l0rd avatar Jul 24 '24 15:07 l0rd

LGTM @n1hility @baude @ashley-cui PTAL

rhatdan avatar Jul 24 '24 15:07 rhatdan

Is this something we can test?

mheon avatar Jul 24 '24 17:07 mheon

Is this something we can test?

I am going to add an e2e test. Converted it back to draft mode.

l0rd avatar Jul 25 '24 16:07 l0rd

LGTM

n1hility avatar Jul 25 '24 17:07 n1hility

I have added a new e2e machine test podman build contexts in pkg/machine/e2e/basic_tests.go.

I have also updated pkg/machine/e2e/README.md with more instructions to run the tests on windows. There are also a couple of small fixes in build_windows.md that are unrelated to the additional contexts but too small to deserve a dedicated PR.

Tests are green. I am switching this PR back to ready for review.

l0rd avatar Jul 29 '24 22:07 l0rd

@containers/podman-maintainers PTAL

l0rd avatar Aug 06 '24 08:08 l0rd

/approve /lgtm

rhatdan avatar Aug 06 '24 10:08 rhatdan

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: l0rd, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Aug 06 '24 10:08 openshift-ci[bot]

Does this mean Podman will now just work with Dev Containers? I can scarcely contain my excitement!

worldofgeese avatar Aug 06 '24 11:08 worldofgeese

Does this mean Podman will now just work with Dev Containers? I can scarcely contain my excitement!

A few clarifications:

  • This is now merged in main branch and will be included in next stable version of Podman (i.e. v5.3.0)
  • The machine provider needs to be WSL (Hyper-V supports needs #23429)
  • The devcontainer.json should include the following runArgs and containerEnv (but I think it may be avoided in rootless mode):
    "runArgs": [
    "--userns=keep-id"
    ],
    "containerEnv": {
    "HOME": "/home/node"
    }

l0rd avatar Aug 06 '24 12:08 l0rd

@l0rd thank you!

JustinGrote avatar Aug 06 '24 15:08 JustinGrote