Skip to content

Migration from Docker to OrbStack

Recently, my company abandoned docker desktop because it requires the company to paid for its services. As a result, the company treats as an unnecessary cost and asks the developers to find another alternatives. This blog records the troublesome during my migration.

Docker and Docker Desktop

In short, docker is the CLI tool and the docker desktop provides the powerful feature as a background service. No matter how to docker(CLI) is installed, its configuration locates at ~/.docker.

  .docker pwd
/Users/yuchen.xie/.docker
  .docker tree . -L 1
.
├── cli-plugins
├── config.json
└── contexts

Note that this kind of information won't appear in docker --help, instead it stays in man docker, which provides the full explanation of the flags.

OPTIONS
       --help
         Print usage statement


       --config=""
         Specifies the location of the Docker client configuration files. The default is '~/.docker'.

       -H, --host=[unix:///var/run/docker.sock]: tcp://[host]:[port][path] to bind or unix://[/path/to/socket] to use.
         The socket(s) to bind to in daemon mode specified using one or more
         tcp://host:port/path, unix:///path/to/socket, fd://* or fd://socketfd.
         If the tcp port is not specified, then it will default to either 2375 when
         --tls is off, or 2376 when --tls is on, or --tlsverify is specified.

OrbStack Migration

OrbStack helps to start the docker background service and provides the socket for communication, and it will be put under the ~/.orbstack while the docker sock will be put under run:

➜  .orbstack tree .
.
├── bin
├── config
├── data
├── log
├── run
│   ├── docker.sock
│   ├── sconrpc.sock
│   ├── sconssh.sock
│   ├── status
│   ├── vmcontrol.sock
│   └── vmgr.version
├── shell
├── ssh
└── vmstate.json

The default docker host stays at /var/run/docker.sock. The OrbStack is very nice because it will create a soft link from its own ~/.orbstack/run/docker.sock to the default one.

However, specifying the docker host path is possible as well, but note to avoid this case:

# ~/.zshrc
export DOCKER_HOST=~/.orbstack/run/docker.sock

The docker host will treat it as a sub-path if the protocol isn't specified, as a result, the host you set up is appended after the default path.

➜  .docker docker run -it -p 80:80 docker/getting-started
docker: Cannot connect to the Docker daemon at tcp://localhost:2375/Users/yuchen.xie/.orbstack/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

Specify the unix protocol could solve this issue and absolute path is required.

# ~/.zshrc
- export DOCKER_HOST=~/.orbstack/run/docker.sock
+ export DOCKER_HOST=unix:///Users/yuchen.xie/.orbstack/run/docker.sock