From c1992a7772d73f075c1bdabd05ba0a8f02dea63c Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 3 Dec 2023 09:53:07 +0100 Subject: [PATCH] fix: Default RAM size * fix: Default RAM size --- Dockerfile | 2 +- docker-compose.yml | 5 +++-- readme.md | 8 ++++---- src/reset.sh | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 470c6c2..294cd41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,8 +27,8 @@ EXPOSE 22 EXPOSE 5900 ENV CPU_CORES "1" +ENV RAM_SIZE "1G" ENV DISK_SIZE "16G" -ENV RAM_SIZE "512M" ENV BOOT "http://www.example.com/image.iso" ARG VERSION_ARG="0.0" diff --git a/docker-compose.yml b/docker-compose.yml index 43e0c37..25e34f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,17 +5,18 @@ services: image: qemux/qemu-docker:latest environment: DISPLAY: "vnc" + RAM_SIZE: "1G" CPU_CORES: "1" - RAM_SIZE: "512M" DISK_SIZE: "16G" BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-standard-3.18.2-x86_64.iso" devices: - /dev/kvm + - /dev/net/tun - /dev/vhost-net device_cgroup_rules: - 'c *:* rwm' cap_add: - - NET_ADMIN + - NET_ADMIN ports: - 2222:22 - 5900:5900 diff --git a/readme.md b/readme.md index ed709ca..81685ed 100644 --- a/readme.md +++ b/readme.md @@ -69,10 +69,10 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm ```yaml environment: - DISK_SIZE: "256G" + DISK_SIZE: "128G" ``` - This can also be used to resize the existing disk to a larger capacity without data loss. + This can also be used to resize the existing disk to a larger capacity without any data loss. * ### How do I change the location of the data disk? @@ -87,12 +87,12 @@ docker run -it --rm -e "BOOT=http://www.example.com/image.iso" --device=/dev/kvm * ### How do I increase the amount of CPU or RAM? - By default, a single core and 512 MB of RAM are allocated to the container. To increase this, add the following environment variables: + By default, a single core and 1 GB of RAM are allocated to the container. To increase this, add the following environment variables: ```yaml environment: + RAM_SIZE: "4G" CPU_CORES: "4" - RAM_SIZE: "2048M" ``` * ### How do I verify if my system supports KVM? diff --git a/src/reset.sh b/src/reset.sh index 13f1789..499a3cd 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -15,8 +15,8 @@ trap 'error "Status $? while: ${BASH_COMMAND} (line $LINENO/$BASH_LINENO)"' ERR : ${ALLOCATE:='Y'} # Preallocate diskspace : ${ARGUMENTS:=''} # Extra QEMU parameters : ${CPU_CORES:='1'} # Amount of CPU cores +: ${RAM_SIZE:='1G'} # Maximum RAM amount : ${DISK_SIZE:='16G'} # Initial data disk size -: ${RAM_SIZE:='512M'} # Maximum RAM amount # Helper variables