Search code examples
macosdockerdockerfileapt

how does docker use apt-get in mac?


I have those lines in a Dockerfile:

RUN apt-get update && apt-get install -y --no-install-recommends
  <list of packages>

I'm able to build a docker image via docker build -f Dockerfile ... in mac.

given that mac doesn't have apt-get, how does that work under the hood? Particularly, if I run a linux container in macOS and there is a python script with a dependency on some package installed with apt-get, how is that dependency resolved in the Mac environment?


Solution

  • Maybe this post or this post can help you. There you can find the following lines:

    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.