Integrating With Docker Desktop

This tutorial shows how to integrate SpinKube and Docker Desktop

Docker Desktop is an open-source application that provides all the essentials to work with containers and Kubernetes on your desktop.


The prerequisites for this tutorial are the Docker Desktop and assets listed in the SpinKube quickstart. Let’s dive in.

Docker Desktop

First, install the latest version of Docker Desktop.

Docker Desktop Preferences

WebAssembly (Wasm) support is still an in-development (Beta) feature of Docker Desktop. Wasm support is disabled by default. To turn it on, open your Docker Desktop settings menu and click the gear icon in the top right corner of the navigation bar. Click Extensions from the menu on the left and ensure that boxes relating to Docker Marketplace and Docker Extensions system containers are checked (as shown in the image below). Checking these boxes enables the “Features in development” extension.

Docker Desktop Extensions

Please ensure that you press “Apply & restart” to save any changes.

Click on Features in development from the menu on the left, and enable the following two options:

  • “Use containerd for pulling and storing images”: This turns on containerd support, which is necessary for Wasm.
  • “Enable Wasm”: This installs the Wasm subsystem, which includes containerd shims and Spin (among other things).

Docker Desktop Enable Wasm

Make sure you press “Apply & restart” to save the changes.

Docker Desktop is Wasm-ready!

Click on “Kubernetes” and check the “Enable Kubernetes” box, as shown below.

Enable Kubernetes

Make sure you press “Apply & restart” to save the changes.

Select docker-desktop from the Kubernetes Contexts configuration in your toolbar.

Kubernetes Context


The following commands are from the SpinKube Quickstart guide. Please refer to the quickstart if you have any queries.

The following commands install all of the necessary items that can be found in the quickstart:

kubectl apply -f
kubectl apply -f
kubectl apply -f
kubectl apply -f

helm install spin-operator \
  --namespace spin-operator \
  --create-namespace \
  --version 0.1.0 \
  --wait \
helm repo add kwasm

helm install \
  kwasm-operator kwasm/kwasm-operator \
  --namespace kwasm \
  --create-namespace \

kubectl annotate node --all

Creating Our Spin Application

Next, we create a new Spin app using the Javascript template:

spin new -t http-js hello-docker --accept-defaults
cd hello-docker
npm install

We then edit the Javascript source file (the src/index.js file) to match the following:

export async function handleRequest(request) {
    return {
        status: 200,
        headers: {"content-type": "text/plain"},
        body: "Hello from Docker Desktop" // <-- This changed

All that’s left to do is build the app:

spin build

Deploying Our Spin App to Docker

We publish our application using the spin registry command:

docker push tpmccallum/hello-docker

The command above will return output similar to the following:

Using default tag: latest
The push refers to repository []
latest: digest: sha256:f24bf4fae2dc7dd80cad25b3d3a6bceb566b257c03b7ff5b9dd9fe36b05f06e0 size: 695

Once published, we can read the configuration of our published application using the spin kube scaffold command:

spin kube scaffold -f tpmccallum/hello-docker

The above command will return something similar to the following YAML:

kind: SpinApp
  name: hello-docker
  image: "tpmccallum/hello-docker"
  executor: containerd-shim-spin
  replicas: 2

We can run this using the following command:

spin kube deploy --from

If we look at the “Images” section of Docker Desktop we see tpmccallum/hello-docker:

Docker Desktop Images

We can test the Wasm-powered Spin app that is running via Docker using the following request:

curl localhost:3000

Which returns the following:

Hello from Docker Desktop