How Do I Run a Docker Container on a Mac

All containers running on a system share the same kernel; Mac OS X does not use the Linux kernel, but rather a mach kernel, so it cannot be run inside a Docker container at this time. You can run Docker on your Mac using a virtual machine, but containers running on that instance would need to run Linux.

Can Docker container run on Mac?

All containers running on a system share the same kernel; Mac OS X does not use the Linux kernel, but rather a mach kernel, so it cannot be run inside a Docker container at this time. You can run Docker on your Mac using a virtual machine, but containers running on that instance would need to run Linux.

How do I run a running Docker container?

  1. Use docker ps to get the name of the existing container.
  2. Use the command docker exec -it <container name> /bin/bash to get a bash shell in the container.
  3. Generically, use docker exec -it <container name> <command> to execute whatever command you specify in the container.
Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest