Skip to content

Commit 11c2274

Browse files
authored
wasm-patch (docker#15955)
* wasm-patch * fix warning note
1 parent 394d048 commit 11c2274

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

desktop/wasm/index.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,31 @@ To learn more about the launch and how it works, read [the launch blog post here
1414
> The Docker+Wasm feature is currently in [Beta](../../release-lifecycle.md/#beta). We recommend that you do not use this feature in production environments as this feature may change or be removed from future releases.
1515
1616

17-
## Enabling the Docker+Wasm integration
17+
## Enable the Docker+Wasm integration
1818

19-
The Docker+Wasm integration currently requires a special build of Docker Desktop.
19+
The Docker+Wasm integration currently requires a technical preview build of Docker Desktop.
2020

21-
- **Important note #1:** This is a technical preview build of Docker Desktop and things might not work as expected. Be sure to back up your containers and images before proceeding.
22-
- **Important note #2:** This preview has the containerd image store enabled and cannot be disabled. If you’re not currently using the containerd image store, then pre-existing images and containers will be inaccessible.
21+
>**Warning**
22+
>
23+
> With the technical preview build of Docker Desktop, things might not work as expected. Be sure to back up your containers and images before proceeding.
24+
{: .warning}
25+
26+
>**Important**
27+
>
28+
> The technical preview build enables the [Containerd Image Store](../containerd/index.md) feature. This cannot be disabled. If you’re not currently using the Containerd Image Store, then pre-existing images and containers will be inaccessible.
29+
{: .important}
2330

24-
You can download the technical preview build of Docker Desktop here:
31+
Download the technical preview build of Docker Desktop:
2532

2633
- [macOS Apple Silicon](https://dockr.ly/3sf56vH)
2734
- [macOS Intel](https://dockr.ly/3VF6uFB)
2835
- [Windows AMD64](https://dockr.ly/3ShlsP0)
2936
- Linux Arm64 ([deb](https://dockr.ly/3TDcjRV))
3037
- Linux AMD64 ([deb](https://dockr.ly/3TgpWH8), [rpm](https://dockr.ly/3eG6Mvp), [tar](https://dockr.ly/3yUhdCk))
3138

32-
3339
## Usage examples
3440

35-
### Running a Wasm application with docker run
41+
### Running a Wasm application with `docker run`
3642

3743
```
3844
$ docker run -dp 8080:8080 \
@@ -42,10 +48,10 @@ $ docker run -dp 8080:8080 \
4248
michaelirwin244/wasm-example
4349
```
4450

45-
Note the addition of two additional flags to the run command:
51+
Note the two additional flags to the run command:
4652

47-
- **--runtime=io.containerd.wasmedge.v1** - This informs the Docker engine that we want to use the Wasm containerd shim instead of the standard Linux container runtime
48-
- **--platform=wasi/wasm32** - This specifies the architecture of the image we want to use. By leveraging a Wasm architecture, we don’t need to build separate images for the different machine architectures. The Wasm runtime will do the final step of converting the Wasm binary to machine instructions.
53+
- `--runtime=io.containerd.wasmedge.v1`. This informs the Docker engine that you want to use the Wasm containerd shim instead of the standard Linux container runtime
54+
- `--platform=wasi/wasm32`. This specifies the architecture of the image you want to use. By leveraging a Wasm architecture, you don’t need to build separate images for the different machine architectures. The Wasm runtime does the final step of converting the Wasm binary to machine instructions.
4955

5056
### Running a Wasm application with Docker Compose
5157

@@ -61,20 +67,19 @@ services:
6167
- 8080:8080
6268
```
6369
64-
Then start the application using the normal Docker Compose commands:
70+
Start the application using the normal Docker Compose commands:
6571
6672
```
6773
docker compose up
6874
```
6975

70-
7176
### Running a multi-service application with Wasm
7277

73-
Networking works the same as you expect with Linux containers, giving you the flexibility to combine Wasm applications with other containerized workloads (such as a database) in a single application stack.
78+
Networking works the same as you expect with Linux containers, giving you the flexibility to combine Wasm applications with other containerized workloads, such as a database, in a single application stack.
7479

75-
In this example, the Wasm application will leverage a MariaDB database running in a container.
80+
In the following example, the Wasm application leverages a MariaDB database running in a container.
7681

77-
1. Start by cloning the repository.
82+
1. Clone the repository.
7883

7984
```
8085
$ git clone https://github.com/second-state/microservice-rust-mysql.git
@@ -100,15 +105,15 @@ In this example, the Wasm application will leverage a MariaDB database running i
100105
microservice-rust-mysql-db-1 | Version: '10.9.3-MariaDB-1:10.9.3+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
101106
```
102107
103-
3. In another terminal, we can see the Wasm image that was created.
108+
In another terminal, we can see the Wasm image that was created.
104109
105110
```
106111
$ docker images
107112
REPOSITORY TAG IMAGE ID CREATED SIZE
108113
server latest 2c798ddecfa1 2 minutes ago 3MB
109114
```
110115
111-
4. Inspecting the image will show the image has a `wasi/wasm32` platform (combination of Os and Architecture).
116+
Inspecting the image shows the image has a `wasi/wasm32` platform. A combination of Os and Architecture.
112117
113118
```
114119
$ docker image inspect server | grep -A 3 "Architecture"
@@ -118,14 +123,14 @@ In this example, the Wasm application will leverage a MariaDB database running i
118123
"VirtualSize": 3001146,
119124
```
120125
121-
5. Open the website at http://localhost:8090 and create a few sample orders. All of these are interacting with the Wasm server.
126+
3. Open the website at http://localhost:8090 and create a few sample orders. All of these are interacting with the Wasm server.
122127
123-
6. When you're all done, tear everything down by hitting Ctrl+C in the terminal you launched the application.
128+
4. When you're all done, tear everything down by hitting `Ctrl+C` in the terminal you launched the application.
124129
125130
126131
### Building and pushing a Wasm module
127132
128-
1. Create a Dockerfile that will build your Wasm application. This will vary depending on the language you are using.
133+
1. Create a Dockerfile that builds your Wasm application. This varies depending on the language you are using.
129134
130135
2. In a separate stage in your `Dockerfile`, extract the module and set it as the `ENTRYPOINT`.
131136
@@ -152,7 +157,7 @@ In this example, the Wasm application will leverage a MariaDB database running i
152157
153158
## Docker+Wasm Release Notes
154159
155-
(2022-10-24)
160+
2022-10-24
156161
Initial release
157162
158163
### New
@@ -166,4 +171,4 @@ Initial release
166171
167172
## Feedback
168173
169-
Thanks for trying the new Docker+Wasm integration. We’d love to hear from you! Please feel free to give feedback or report any bugs you may find through the issues tracker on the [public roadmap item](https://github.com/docker/roadmap/issues/426){: target="_blank" rel="noopener" class="_"}.
174+
Thanks for trying the new Docker+Wasm integration. Give feedback or report any bugs you may find through the issues tracker on the [public roadmap item](https://github.com/docker/roadmap/issues/426){: target="_blank" rel="noopener" class="_"}.

0 commit comments

Comments
 (0)