LoginSignup
1
1

macOS + Podman V5では--volumeでのMac上パス指定における/mntが不要に

Last updated at Posted at 2024-04-29

備考

追記

/userなどはPodman 4.1からそのまま使えたと教えてもらいました。
https://x.com/tnk4on/status/1785156002603762158
https://github.com/containers/common/pull/1265

環境

Apple M1 Pro 16 GB
macOS sonoma バージョン14.4.1(23E224)
podman version 5.0.2

macOS + Podman V4.0では

macOS + Podman V4.0では--volumeでのホストシステムのパスの先頭に/mntを付与する必要がありました。

更新:
なお、上の追記のとおり、Podman 4.1から/userは/mntなしで使えた様です。

macOS + Podman V5では

podman machineがqemuベースからapplehvベースに変更になり、あわせてホストファイルシステムへのアクセスも更新され、--volumeでのホストシステムのパスがそのまま指定でき/mntが不要になっていました。

更新:
なお、上の追記の通り、V5からという訳ではなくV4.1からディレクトリーによっては対応された様です。

% podman --version   
podman version 5.0.2

% podman machine list  
NAME                     VM TYPE     CREATED     LAST UP            CPUS        MEMORY      DISK SIZE
podman-machine-default*  applehv     6 days ago  Currently running  4           2GiB        100GiB

% cat HELLO
cat: HELLO: No such file or directory

% podman run -it --rm -v $(pwd):/workspace -w /workspace registry.access.redhat.com/ubi8/ubi sh -c "echo hello > HELLO"

% cat HELLO
hello

-v $(pwd):xxxxでカレントディレクトリーをそのまま指定できている。

参照

Podman V4での指定

Podman V5での変更

This was an important step forward for the project, and helps better enable our second objective for this release: the introduction of support for the Apple-native Hypervisor. We were able to do this for both Intel and Apple Silicon processors, enabling compatibility for developers using a broad variety of hardware. In addition to Apple-native Hupervisor, we have also moved to virtiofs for access to local files systems on the MacOS, which is a huge improvement over Plan 9 for file system access within the VM.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1