remove test.sh
This commit is contained in:
+5
-2
@@ -3,13 +3,16 @@ services:
|
||||
cloud:
|
||||
image: bearcloud:latest
|
||||
network_mode: host
|
||||
environment:
|
||||
CPU_COUNT: 4
|
||||
MEMORY: "4G"
|
||||
NET_INTERFACE: ""
|
||||
NET_MAC: ""
|
||||
volumes:
|
||||
- "./data:/image"
|
||||
- "./test.sh:/test.sh"
|
||||
devices:
|
||||
- "/dev/kvm:/dev/kvm"
|
||||
- "/dev/net/tun:/dev/net/tun"
|
||||
entrypoint: ["/sbin/tini", "/test.sh"]
|
||||
cap_add:
|
||||
- CAP_SYS_ADMIN
|
||||
- CAP_NET_ADMIN
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -euo pipefail
|
||||
|
||||
API_SOCKET="/hy.socks"
|
||||
|
||||
_stop() {
|
||||
ch-remote shutdown-vmm
|
||||
ch-remote --api-socket "$API_SOCKET" power-button
|
||||
}
|
||||
|
||||
trap _stop EXIT TERM
|
||||
@@ -12,7 +13,9 @@ trap _stop EXIT TERM
|
||||
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
|
||||
--disk path=/image/vm.raw,image_type=raw \
|
||||
--disk path=/image/data.raw,direct=on,image_type=raw \
|
||||
--api-socket "$API_SOCKET" \
|
||||
--cmdline "root=/dev/vda rootfstype=ext4 modules=ext4a rw console=hvc0" \
|
||||
--cpus boot=${CPU_COUNT:-4} \
|
||||
--memory size=${MEMORY:-4G},shared=on \
|
||||
--net "tap=$NET_INTERFACE,mac=$NET_MAC"
|
||||
$@
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -euo pipefail
|
||||
|
||||
exec /usr/bin/cloud-hypervisor \
|
||||
--kernel /boot/vmlinuz-virt --initramfs /boot/initramfs-virt \
|
||||
--disk path=/image/vm.raw,image_type=raw \
|
||||
--disk path=/image/data.raw,direct=on,image_type=raw \
|
||||
--cmdline "modules=ext4 root=/dev/vda rootfstype=ext4 rw console=hvc0" \
|
||||
--cpus boot=${CPU_COUNT:-4} \
|
||||
--memory size=${MEMORY:-4G},shared=on \
|
||||
--net "tap="
|
||||
$@
|
||||
Reference in New Issue
Block a user