Skip to content

Commit

Permalink
README update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmrigney committed Dec 14, 2022
1 parent 07e35a3 commit 7740ef6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# wasm-docker-extension
An example Docker Desktop extension that uses Wasm for the backend.
# Wasm Docker Extension Example
An example Docker Desktop extension that uses Wasm for the backend instead of a Linux container.

![Screenshot of Wasm Extension](/docs/screenshot.png)

## How it works

The Rust code in `vm` gets compiled to a *.wasm binary in the `Dockerfile` build process. The build then sets the entry point of the image to that *.wasm binary. See [Docker+Wasm docs](https://docs.docker.com/desktop/wasm/).

The Wasm backend app is an Http server that runs on port 1234 to communicate with the frontend `ui` of the extension. **Note:** Docker Desktop extensions should normally communicate via named socket to avoid port conflicts and security risks that entails. However, there is currently no support for named sockets in Wasm/Wasi. This could [potentially change soon](https://github.com/WasmEdge/WasmEdge/issues/2138) in WasmEdge, the Wasm runtime we use.

## Installing

As of Docker Desktop v4.15.0, you must have the experimental containerd image store enabled.

![Screenshot of containerd image store setting](/docs/containerdstore.png)

Note that your firewall may prompt you to allow port 1234 for the extension.

Click [this link](docker-desktop://extensions/marketplace?extensionId=crigneydocker/wasm-extension&tag=latest) or run:

```
docker extension install crigneydocker/wasm-extension
```

## Building

```
make build-extension
make install-extension
```

Have fun building your own Wasm Docker Desktop extensions!
Binary file added docs/containerdstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7740ef6

Please sign in to comment.