Replacing Docker Desktop with VMware Fusion or Workstation

Written by Sam McGeown
Published on 1/9/2021 - Read in about 4 min (780 words)

Just recently Docker announced some new pricing tiers for it’s almost ubiquitous Docker Desktop. I’m not going to opine much on this, time will tell whether this is a company saving move or not. Suffice to say that I work for a large company and would need a subscription to continue using Docker Desktop.

The venerable Corey Quinn was on the news like a flash, so I’ll let you read his thread for some hard core snark analysis.

Do I need Docker Desktop?

This is an important question. I actually don’t use many of Docker Desktop’s features, I rarely use the UI short of rebooting the VM and adjusting it’s memory allocation when I use KIND.

I already have VMware Fusion running on my Macbook Pro, and I can have a CentOS docker host configured as a VM locally, so I can target the docker CLI to use my local docker host and pretty much carry on as usual. The downside of this is that I have to download and install the pre-compiled Docker binary for MacOS, and maintain my docker host VM, which includes patching, updates, configuration etc.

Luckily, I remembered that Fusion (and Workstation) now ships with support for containers through the vctl command. vctl is a pretty much drop in replacement for docker (so much so that I’ve created an alias alias docker=vctl) with the added benefit that Fusion is responsible for the management of a lightweight virtual machine (the CRX VM) to host containers.

Add to that the fact that vctl also supports deploying KIND (Kubernetes-in-Docker) to a CRX VM, and we’ve got a seriously useful tool here!

Getting started with vctl

Assuming that you’ve got Fusion or Workstation installed, getting started with vctl is pretty easy. You can just run vctl system start (or configure the resources for the CMX VMs using the vctl system config commands).

Start the container runtime with vctl
Start the container runtime with vctl

From there, you can use vctl commands like you would docker - as I mentioned before, I have created an alias alias docker=vctl, so the following commands could be using docker instead

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Pull the latest NGINX image
vctl pull nginx
INFO Pulling from index.docker.io/library/nginx:latest
───                                                                                ──────   ────────
REF                                                                                STATUS   PROGRESS
───                                                                                ──────   ────────
index-sha256:4d4d96ac750af48c6a551d757c1cbfc071692309b491b70b2b8976e102dd3fef      Done     100% (1862/1862)
manifest-sha256:5e95e5eb8be4322e3b3652d737371705e56809ed8b307ad68ec59ddebaaf60e4   Done     100% (1570/1570)
layer-sha256:b86f2ba62d17b165964516228297d3ba669d60b6a283b5fd7779b27d7ec33871      Done     100% (1394/1394)
layer-sha256:e21006f71c6fb784a76159590b6ba8ab3fb22e5026f67abcf5feb8e4231837d6      Done     100% (26596486/26596486)
layer-sha256:e1acddbe380c63f0de4b77d3f287b7c81cd9d89563a230692378126b46ea6546      Done     100% (27145985/27145985)
config-sha256:dd34e67e3371dc2d1328790c3157ee42dfcae74afffd86b297459ed87a98c0fb     Done     100% (7732/7732)
layer-sha256:f3341cc17e586daa9660abf087f13b2eba247bcf6646ee972e85d4cbaf18dbae      Done     100% (603/603)
layer-sha256:12455f71a9b5e0c207a601fb32bcf7f10a933d7193574d968409bbc5c2d89fe0      Done     100% (666/666)
layer-sha256:2a53fa598ee20ad436f2f9da7c0a21cce583bd236f47828895d771fb2e8795e1      Done     100% (894/894)
INFO Unpacking nginx:latest...
INFO done

# View the images available locally
vctl images
────                                  ─────────────               ────
NAME                                  CREATION TIME               SIZE
────                                  ─────────────               ────
nginx:latest                          2021-09-01T17:33:12+01:00   51.3 MiB
sammcgeown/codestream-ci-tkg:latest   2021-09-01T16:16:19+01:00   1.2 GiB
sammcgeown/codestream-ci:latest       2021-09-01T16:14:52+01:00   188.9 MiB

# Run an NGINX instance that hosts the local directory
vctl run -v $(pwd):/usr/share/nginx/html:ro -d -p 8080:80 nginx
INFO container nginx-cff5 started and detached from current session

# Exec to run commands in the container
docker exec -it nginx-cff5 /bin/bash
root@nginx-cff5:/# uname -a
Linux nginx-cff5 4.19.138-7.ph3-esx 1-photon SMP Thu Aug 27 20:40:23 UTC 2020 x86_64 GNU/Linux
root@nginx-cff5:/# exit
exit

# Stop and delete the VM
vctl stop nginx-cff5 && vctl rm nginx-cff5
INFO container nginx-cff5 has been stopped
────         ──────    ──────
NAME         RESULT    REASON
────         ──────    ──────
nginx-cff5   REMOVED

Using KIND with vctl

Creating a KIND cluster with vctl is, again, a trivial thing. You can configure memory and CPU with the vctl system config commands, or go with the defaults. Running vctl kind configures an alias for docker so that kind cluster create will use vctl. After that you can use your kind cluster in exactly the normal way.

Build a KIND (Kubernetes in Docker) cluster with vctl
Build a KIND (Kubernetes in Docker) cluster with vctl

Final thoughts

So far, I’m loving vctl - so much so I’ve removed Docker Desktop from my laptop completely and am relying on it as my main driver! The key for me is that it’s super easy to switch and virtually a drop in replacement.

I’d love to hear how you plan to deal with Docker’s new pricing structures - are you affected? Will you pay up, or will you find an alternative? Docker have to find a viable business model, that’s for sure…is it this? I don’t know.

Tweet me @sammcgeown!

Share this post