# Install Lima ```bash username@mac:workdir $ brew install lima ``` # Prepare Docker-CLI & Docker Compose ## Using Homebrew ```bash username@mac:workdir $ brew install docker docker-compose ``` ## (Optional) Build from source ```bash username@other-mac-with-docker:workdir $ git clone https://github.com/docker/cli.git && cd cli && docker buildx bake # output: ./build/docker username@other-mac-with-docker:workdir $ git clone https://github.com/docker/compose.git && cd compose && make # output: ./bin/docker-compose ``` # Setup ```bash # Start Lima username@mac:workdir $ limactl start --name=docker docker.yaml # Create docker context for Lima username@mac:workdir $ export LIMA_HOME="PATH_TO_LIMA_HOME" username@mac:workdir $ docker context create lima --docker "host=unix://$(LIMA_HOME)/docker/sock/docker.sock" # Optionally, you can do below to use lima as your default docker context. username@mac:workdir $ export DOCKER_CONTEXT="lima" ``` # Cheatsheet ```bash # Obvious stuffs username@mac:workdir $ limactl --help username@mac:workdir $ limactl info username@mac:workdir $ limactl ls # Shell into base linux VM username@mac:workdir $ limactl shell docker bash # Start/Stop/Edit base linux VM username@mac:workdir $ limactl start docker username@mac:workdir $ limactl stop docker username@mac:workdir $ limactl edit docker ``` # (Optional) Update docker.yaml for Lima ```yaml # Tune VM host spec cpus: 8 memory: 16GiB disk: 60GiB # Mount directories you want to expose mounts: - location: "~/Dev/docker" writable: true - location: "~/Downloads" writable: true ``` # References - Lima: https://github.com/lima-vm/lima - Docker CLI(Homebrew): https://formulae.brew.sh/formula/docker#default - Docker Compose(Homebrew): https://formulae.brew.sh/formula/docker#default - Docker CLI(Source): https://github.com/docker/cli - Docker compose(Source): https://github.com/docker/compose/