Install docker-cli without Docker Desktop
Docker Desktop is no longer available for free. People have to uninstall it if company didn't buy a commercial license.
However, docker-engine and docker-cli reminds free and open source.
Download docker-cli
Even though there is no option to download docker-cli only official website, the docker-cli binary is available in its repository.
Download for Windows
Download for Linux
Download for macOS
Connect to remote docker backend (or WSL)
Docker Desktop actually install two components for you:
- dockerd: the daemon service listens to
unix:///var/run/docker.sock
- docker: the cli connects to
unix:///var/run/docker.sock
.
Docker supports opening service at TCP protocol. So you can use this feature to run command in local machine and connect to a remote dockerd service, such as remote development server, a Linux VM, or WSL.
Start dockerd and listen to TCP address
You can either:
- Update
/etc/docker/daemon.json
:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
- Or use the command line argument:
/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock ...
note: dockerd will fail to start up if you set -H argument and hosts in daemon.json simultaneously.
Set DOCKER_HOST
You can set environment variable "DOCKER_HOST" as "tcp://0.0.0.0:2375", to tell docker-cli where to connect.