2021.5.19 周三
留●白
宜
沉思 浮躁
忌
今日推荐
Lima:Linux-on-mac(“用于Linux的macOS子系统”,“用于Mac的容器”)
这个项目是用go写的,对于正在学习go的朋友,可以研究研究这个。
Lima在macOS上启动Linux虚拟机,并具有自动文件共享,端口转发和容器化功能。可以将Lima视为某种非官方的“ Linux的macOS子系统”,或“ Mac的容器”。Lima的目标是向Mac用户推广包含nerdctl(contaiNERD ctl)的容器,但是Lima也可以用于非容器应用程序。
示例:
代码语言:javascript复制$ uname -a
Darwin macbook.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64
$ lima uname -a
Linux lima-default 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:12:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ LIMA_INSTANCE=arm lima uname -a
Linux lima-arm 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:10:16 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
跨macOS和Linux共享文件
代码语言:javascript复制$ echo "files under /Users on macOS filesystem are readable from Linux" > some-file
$ lima cat some-file
files under /Users on macOS filesystem are readable from Linux
$ lima sh -c 'echo "/tmp/lima is writable from both macOS and Linux" > /tmp/lima/another-file'
$ cat /tmp/lima/another-file
/tmp/lima is writable from both macOS and Linux"
运行容器化容器(与Docker容器兼容)
代码语言:javascript复制$ lima nerdctl run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine
http://127.0.0.1:8080 is accessible from both macOS and Linux. NOTE Privileged ports (1-1023) cannot be forwarded
For the usage of containerd and nerdctl (contaiNERD ctl), visit https://github.com/containerd/containerd and https://github.com/containerd/nerdctl.
关于具体的安装和使用方法,可以去GitHub查看,作者在readme文件里面描述的很清楚。
废话不多说,上地址:
https://github.com/AkihiroSuda/lima
来源:GitHub(侵删) 图片:网络(侵删)
DESIGNED BY ZOE · 2020