Docker for Mac uses a lot of resources, especially in terms of CPU and disk space. Connecting to a remote instance of Docker means my MacbookPro can put those resources towards my IDE.
Requirements
A server with SSH access.
docker and docker-machine on your computer.
Ansible Role
I created a role to automate the process; It's setting up a user to do the bootstrapping, opening up port 2376 on the server and then calling docker-machine on your computer to bootstrap docker.
❯ docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.14
Git commit: afacb8b
Built: Thu Mar 12 02:45:41 2020
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:24:19 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Commands
Commands I use a fair amount
Reclaim space
❯ docker system prune -a --volumes
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all images without at least one container associated to them
- all build cache
Are you sure you want to continue? [y/N]