@@ -42,6 +42,14 @@ Example of running cargo build on the kvm crate:
42
42
Finished ` release` profile [optimized] target(s) in 6.34s
43
43
```
44
44
45
+ For Windows users (ensure Docker Desktop is in Linux containers mode):
46
+ ``` powershell
47
+ > git clone https://github.com/rust-vmm/kvm.git
48
+ > cd kvm
49
+ > docker run --volume "${PWD}:/kvm" `
50
+ rustvmm/dev:latest `
51
+ /bin/bash -c "cd /kvm && cargo build --release"
52
+ ```
45
53
## Testing Changes locally with the Container Image
46
54
47
55
When we modify the container to install new dependencies, we may need to
@@ -74,6 +82,28 @@ Since you've mounted the host's current directory ($(pwd)) to `/workdir` in
74
82
the container, any files in the current working directory on the host will be
75
83
accessible in the ` /workdir ` directory inside the container.
76
84
85
+ For Windows (ensure Docker Desktop is in Linux containers mode):
86
+ ``` powershell
87
+ > cd rust-vmm-container
88
+ > .\docker.ps1 build
89
+
90
+ # Example output: Build completed for rustvmm/dev:gb607c2b_x86_64
91
+
92
+ # Test the container using the tag from the build output
93
+ > docker run -it --rm `
94
+ --volume "${PWD}:/path/to/workdir" `
95
+ --workdir /path/to/workdir `
96
+ rustvmm/dev:gb607c2b_x86_64
97
+ ```
98
+
99
+ Note: Unlike Linux, Windows doesn't have direct access to KVM, so the ` --device=/dev/kvm ` and ` --privileged ` flags are not needed.
100
+
101
+ Note: If you want to build a Windows container instead, you can switch Docker Desktop to "Windows containers" mode and run:
102
+ ``` powershell
103
+ > cd rust-vmm-container
104
+ > .\docker.ps1 build # This will automatically use Dockerfile.windows.x86_64
105
+ ```
106
+
77
107
## Publishing a New Version
78
108
79
109
A new container version is published for each PR merged to main that adds
@@ -107,6 +137,13 @@ On an `aarch64` platform:
107
137
> ./docker.sh publish
108
138
```
109
139
140
+ On Windows (ensure Docker Desktop is in Linux containers mode):
141
+ ``` powershell
142
+ > cd rust-vmm-container
143
+ > .\docker.ps1 build
144
+ > .\docker.ps1 publish
145
+ ```
146
+
110
147
You will need to redo all steps on an ` x86_64 ` platform so the containers are
111
148
kept in sync (same package versions on both ` x86_64 ` and ` aarch64 ` ).
112
149
@@ -123,4 +160,4 @@ If it is the first time you are creating a docker manifest, most likely it will
123
160
fail with: ```docker manifest is only supported when experimental cli features
124
161
are enabled```. Checkout
125
162
[ this article] ( https://medium.com/@mauridb/docker-multi-architecture-images-365a44c26be6 )
126
- to understand why and how to fix it.
163
+ to understand why and how to fix it.
0 commit comments