Skip to content

Commit d9969a8

Browse files
committed
feat: change disks naming
1 parent 36f31c7 commit d9969a8

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/blobs
1+
/tmp/
2+
/disks/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/blobs*
1+
/tmp/
2+
/disks/
File renamed without changes.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ flowchart TD
4141
BaseDisk --> Disk3[(VM 3 Disk)]
4242
```
4343

44-
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):
44+
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 `/disks` using the following command (example):
4545

4646
```bash
47-
qemu-img create -b /image/ubuntu.img -F qcow2 -f qcow2 /blobs/disk.img 10G
47+
qemu-img create -b /image/ubuntu.img -F qcow2 -f qcow2 /disks/disk.img 10G
4848
```
4949

50-
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.
50+
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 `/disks/disk.img` already exists, `devmachines/runtime` takes no action, even if the `STORAGE` value has changed.
5151

5252
## Setup Diagram
5353

@@ -116,8 +116,8 @@ Start VM
116116
qemu-system-x86_64 \
117117
-m 2048 \
118118
-smp 2 \
119-
-drive file=/blobs/disk.img,format=qcow2,if=virtio \
120-
-drive file=/blobs/seed.iso,format=raw,if=virtio \
119+
-drive file=/disks/disk.img,format=qcow2,if=virtio \
120+
-drive file=/disks/cloudinit.iso,format=raw,if=virtio \
121121
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
122122
-device virtio-net-pci,netdev=net0 \
123123
-qmp unix:/tmp/qmp-sock,server,wait=off \

cloudinit/iso.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/utkin-tech/devmachines/utils"
88
)
99

10-
const CloudInitIsoPath = "/blobs/seed.iso"
10+
const CloudInitIsoPath = "/disks/cloudinit.iso"
1111

1212
type Network interface {
1313
Addresses() []string

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
PASSWORD: "pass"
1111
SSH_KEYS: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICeyDWnYtatyEiHKjT/jpLUA7FLMoe97ItrkaLA2cYsX qemu_machine"
1212
volumes:
13-
- ./blobs:/blobs
13+
- ./disks:/disks
1414
- image:/image:ro
1515
cap_add:
1616
- NET_ADMIN

disk/disk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
const (
1010
BaseImagePath = "/image/ubuntu.img"
11-
DiskImagePath = "/blobs/disk.img"
11+
DiskImagePath = "/disks/disk.img"
1212
)
1313

1414
type Storage interface {

docker-bake.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ variable "DESTDIR" {
1111
}
1212

1313
target "_common" {
14-
dockerfile = "runtime.Dockerfile"
1514
args = {
1615
GO_VERSION = GO_VERSION
1716
ALPINE_VERSION = ALPINE_VERSION

0 commit comments

Comments
 (0)