Skip to content

Commit c2dc88c

Browse files
committed
Update README with Windows usage instructions
Add instructions to `README.md` for building and running Windows Docker images using docker.ps1. This provides clear guidance for Windows users. Signed-off-by: bashir <[email protected]>
1 parent 56a58d8 commit c2dc88c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Diff for: README.md

+42
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ Example of running cargo build on the kvm crate:
4242
Finished `release` profile [optimized] target(s) in 6.34s
4343
```
4444

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+
```
4553
## Testing Changes locally with the Container Image
4654

4755
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
7482
the container, any files in the current working directory on the host will be
7583
accessible in the `/workdir` directory inside the container.
7684

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+
77107
## Publishing a New Version
78108

79109
A new container version is published for each PR merged to main that adds
@@ -107,6 +137,18 @@ On an `aarch64` platform:
107137
> ./docker.sh publish
108138
```
109139

140+
On Windows (ensure Docker Desktop is in Linux containers mode):
141+
142+
```powershell
143+
> cd rust-vmm-container
144+
> .\docker.ps1 build
145+
> .\docker.ps1 publish
146+
147+
148+
# To check if Docker is in Linux containers mode:
149+
> docker version --format '{{.Server.Os}}' # Should output 'linux'
150+
```
151+
110152
You will need to redo all steps on an `x86_64` platform so the containers are
111153
kept in sync (same package versions on both `x86_64` and `aarch64`).
112154

0 commit comments

Comments
 (0)