Inspired by WSL, I created a Linux subsystem that works on macOS. While macOS already has bash and other Unix tools, I built this to solve compatibility issues with multiple tools on ARM architecture. Since I develop inside containers, this provides an easy way to exec into a container without typing multiple commands.
An alias needs to be set to easily exec into the container.
Add the following alias to your .bashrc or .zshrc file:
alias linux='docker exec -it -w "$(pwd)" ubuntu-noble bash'The Documents folder is mounted inside the container. Just open a terminal and type linux and you'll be in the same directory inside the container!
The container comes pre-installed with:
- .NET SDK - Versions 8.0 and 9.0 with Entity Framework Core CLI
- Go - Version 1.25.1
- Node.js - Version 22.x
- Neovim - Latest version built from source
- Azure CLI - For managing Azure resources
- Docker CLI - Connects to host Docker daemon
- kubectl, kubelogin, k9s - Kubernetes tools
- git, gh - Version control and GitHub CLI
- Development utilities - jq, bat, pandoc, tree, ripgrep, fd-find, fzf, and standard network tools
Personal configuration files (bash aliases, bash history, git config) are stored in mnt/local/ and are gitignored. These files persist across container restarts.
For details on available configuration options, see mnt/local/README.md.
The following configurations are stored in Docker volumes and persist across container restarts:
.kube- Kubernetes configuration (kubectl contexts, credentials).ssh- SSH keys and SSH configuration.config- Application configurations (nvim, etc.)
The host's Docker socket (/var/run/docker.sock) is mounted into the container in read-only mode. This allows you to use Docker CLI inside the container to control the host's Docker daemon. Any containers you create from inside will run on the host, not inside this container.