Skip to content

Commit 01e5a96

Browse files
committed
docs: add env variables and image info
1 parent e06ce9e commit 01e5a96

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"recommendations": [
33
"golang.go",
44
"bierner.markdown-mermaid",
5-
"foxundermoon.shell-format"
5+
"foxundermoon.shell-format",
6+
"yzhang.markdown-all-in-one"
67
]
78
}

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# DevMachines
22

3+
## Installation
4+
5+
Just download `compose.yaml` and start docker:
6+
7+
```sh
8+
wget https://raw.githubusercontent.com/utkin-tech/devmachines/refs/heads/main/compose.yaml
9+
docker compose up -d
10+
```
11+
12+
## Configuration
13+
14+
These variables are used to customize the runtime behavior of the `devmachines/runtime` Docker container. They can be passed via:
15+
- `docker run -e VAR=value`
16+
- Docker Compose `environment:` section
17+
18+
| Env | Default | Example | Description |
19+
| ---------- | ------- | ---------------- | ------------------------------------------ |
20+
| `CPU` | `-` | `2` | Number of CPU cores |
21+
| `MEMORY` | `-` | `2G` | RAM size (supports `G` for GB, `M` for MB) |
22+
| `STORAGE` | `-` | `10G` | Disk storage size (supports `G` for GB) |
23+
| `USER` | `-` | `user` | Default system username |
24+
| `PASSWORD` | `-` | `pass` | Default user password |
25+
| `SSH_KEYS` | `-` | `ssh-ed25519...` | Comma-separated list of public SSH keys |
26+
27+
## Image and disk
28+
29+
In `devmachines`, we use QEMU's `Backing File` function to reduce VM disk size. This allows us to reuse the same OS image across multiple VMs.
30+
31+
```mermaid
32+
flowchart TD
33+
BaseDisk[(Base Disk)] --> Disk1[(VM 1 Disk)]
34+
BaseDisk --> Disk2[(VM 2 Disk)]
35+
BaseDisk --> Disk3[(VM 3 Disk)]
36+
```
37+
38+
Every `devmachines/runtime` container attempts to find an image file (in QCOW2 format) in the `/image` path (currently only `/image/ubuntu.img` is supported) and creates a VM disk in `/blobs` using the following command (example):
39+
40+
```bash
41+
qemu-img create -b /image/ubuntu.img -F qcow2 -f qcow2 /blobs/disk.img 10G
42+
```
43+
44+
You can configure the initial disk size using the `STORAGE` environment variable. It supports size definitions in [`docker/go-units`](https://pkg.go.dev/github.com/docker/go-units#RAMInBytes) format. If the file `/blobs/disk.img` already exists, `devmachines/runtime` takes no action, even if the `STORAGE` value has changed.
45+
346
## Setup Diagram
447

548
```mermaid

0 commit comments

Comments
 (0)