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