我想将 apptainer 用于 macOS 上的特定程序。我已经通过lima安装了apptainer。然而,虽然apptainer是我的路径,但我仍然无法使用它。
这就是我现在的路径:
/users/-myname-/.lima/apptainer:/Users/-myname-/.lima/bin:/opt/homebrew
等等
但是使用apptainer命令后,仍然给出:command not found:apptainer
有人可以帮助我在 macOS 上执行 apptainer 吗?
在配备 M1/2/3 处理器的 MacBook 上,您必须在虚拟机内运行
apptainer
。您可以使用 lima
来实现这一点。
首先,你必须安装lima
警告:由于 CPU 不兼容,您可能无法在其他架构上使用 MacBook 上构建的容器。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install qemu lima
limactl create --name=apptainer template://apptainer
为了能够构建容器,您需要授予
lima
对主目录的写入权限。
vi ~/.lima/apptainer/lima.yml
并改变
mounts:
- location: "~"
- location: "/tmp/lima"
writable: true
到
mounts:
- location: "~"
writeable: true
- location: "/tmp/lima"
writable: true
limactl start apptainer
limactl shell apptainer
apptainer
。apptainer
>>>
Usage:
apptainer [global options...] <command>
Available Commands:
build Build an Apptainer image
cache Manage the local cache
capability Manage Linux capabilities for users and groups
checkpoint Manage container checkpoint state (experimental)
completion Generate the autocompletion script for the specified shell
config Manage various apptainer configuration (root user only)
delete Deletes requested image from the library
exec Run a command within a container
inspect Show metadata for an image
instance Manage containers running as services
key Manage OpenPGP keys
keyserver Manage apptainer keyservers
oci Manage OCI containers
overlay Manage an EXT3 writable overlay image
plugin Manage Apptainer plugins
pull Pull an image from a URI
push Upload image to the provided URI
registry Manage authentication to OCI/Docker registries
remote Manage apptainer remote endpoints
run Run the user-defined default command within a container
run-help Show the user-defined help for an image
search Search a Container Library for images
shell Run a shell within a container
sif Manipulate Singularity Image Format (SIF) images
sign Add digital signature(s) to an image
test Run the user-defined tests within a container
verify Verify digital signature(s) within an image
version Show the version for Apptainer
Run 'apptainer --help' for more detailed usage information.