docker 如何在 mac 中使用 apt-get?

how does docker use apt-get in mac?

我在 Dockerfile:

中有这些行
RUN apt-get update && apt-get install -y --no-install-recommends
  <list of packages>

我可以通过 mac 中的 docker build -f Dockerfile ... 构建 docker 图像。

鉴于 mac 没有 apt-get,它是如何工作的?特别是,如果我在 macOS 中 运行 一个 linux 容器并且有一个 python 脚本依赖于一些安装了 apt-get 的包,如何Mac 环境中是否解决了该依赖关系?

也许 or this post可以帮到你。在那里你可以找到以下几行:

If containers are possible because of the features available in the Linux kernel, then the obvious question is how do non-Linux systems run containers. Both Docker for Mac and Windows use Linux VMs to run the containers. Docker Toolbox used to run containers in Virtual Box VMs. But, the latest Docker uses Hyper-V in Windows and Hypervisor.framework in Mac.