備考
追記
/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.