You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: desktop/wasm/index.md
+27-22Lines changed: 27 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -14,25 +14,31 @@ To learn more about the launch and how it works, read [the launch blog post here
14
14
> 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.
15
15
16
16
17
-
## Enabling the Docker+Wasm integration
17
+
## Enable the Docker+Wasm integration
18
18
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.
20
20
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}
23
30
24
-
You can download the technical preview build of Docker Desktop here:
31
+
Download the technical preview build of Docker Desktop:
25
32
26
33
-[macOS Apple Silicon](https://dockr.ly/3sf56vH)
27
34
-[macOS Intel](https://dockr.ly/3VF6uFB)
28
35
-[Windows AMD64](https://dockr.ly/3ShlsP0)
29
36
- Linux Arm64 ([deb](https://dockr.ly/3TDcjRV))
30
37
- Linux AMD64 ([deb](https://dockr.ly/3TgpWH8), [rpm](https://dockr.ly/3eG6Mvp), [tar](https://dockr.ly/3yUhdCk))
31
38
32
-
33
39
## Usage examples
34
40
35
-
### Running a Wasm application with docker run
41
+
### Running a Wasm application with `docker run`
36
42
37
43
```
38
44
$ docker run -dp 8080:8080 \
@@ -42,10 +48,10 @@ $ docker run -dp 8080:8080 \
42
48
michaelirwin244/wasm-example
43
49
```
44
50
45
-
Note the addition of two additional flags to the run command:
51
+
Note the two additional flags to the run command:
46
52
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.
49
55
50
56
### Running a Wasm application with Docker Compose
51
57
@@ -61,20 +67,19 @@ services:
61
67
- 8080:8080
62
68
```
63
69
64
-
Then start the application using the normal Docker Compose commands:
70
+
Start the application using the normal Docker Compose commands:
65
71
66
72
```
67
73
docker compose up
68
74
```
69
75
70
-
71
76
### Running a multi-service application with Wasm
72
77
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.
74
79
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.
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.
104
109
105
110
```
106
111
$ docker images
107
112
REPOSITORY TAG IMAGE ID CREATED SIZE
108
113
server latest 2c798ddecfa1 2 minutes ago 3MB
109
114
```
110
115
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.
112
117
113
118
```
114
119
$ 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
118
123
"VirtualSize": 3001146,
119
124
```
120
125
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.
122
127
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.
124
129
125
130
126
131
### Building and pushing a Wasm module
127
132
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.
129
134
130
135
2. In a separate stage in your `Dockerfile`, extract the module and set it as the `ENTRYPOINT`.
131
136
@@ -152,7 +157,7 @@ In this example, the Wasm application will leverage a MariaDB database running i
152
157
153
158
## Docker+Wasm Release Notes
154
159
155
-
(2022-10-24)
160
+
2022-10-24
156
161
Initial release
157
162
158
163
### New
@@ -166,4 +171,4 @@ Initial release
166
171
167
172
## Feedback
168
173
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