mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-18 00:01:34 +00:00
Add CPU_COUNT variable. Minor stuff.
This commit is contained in:
+9
-4
@@ -1,21 +1,26 @@
|
||||
version: "3"
|
||||
services:
|
||||
qemu:
|
||||
container_name: openwrt-docker-arm64
|
||||
container_name: openwrt
|
||||
#image: albrechtloh/qemu-openwrt:openwrt-23.05.1-2
|
||||
image: "openwrt-docker-arm64"
|
||||
|
||||
environment:
|
||||
DEBUG: "y"
|
||||
|
||||
# Define number of VM CPUs
|
||||
CPU_COUNT: 4
|
||||
|
||||
# If WAN interface is not specified the Docker network
|
||||
# In this case a port forwarding from port OpenWrt 80 to port 8000 is available
|
||||
#WAN_IF: "enx00e04c0407a6"
|
||||
#LAN_IF: "enx00e04d68033f"
|
||||
|
||||
# USB passtrough
|
||||
# USB passthrough
|
||||
# Format <vendorID>:<productID> like 'lsusb' is given
|
||||
# Currently only one USB device is supported
|
||||
USB_VID_1: "148f" # vendor ID
|
||||
USB_PID_1: "7601" # product ID
|
||||
#USB_VID_1: "148f" # vendor ID
|
||||
#USB_PID_1: "7601" # product ID
|
||||
|
||||
ports:
|
||||
# Port 8006 is console tty web VNC
|
||||
|
||||
@@ -6,7 +6,7 @@ QEMU in a docker container for running arm64 virtual machines. Tested on Raspber
|
||||
|
||||
It uses high-performance QEMU options (like KVM acceleration, kernel-mode networking, IO threading, etc.) to achieve near-native speed.
|
||||
|
||||
Pre-build images can be found a docker hub (TBD)
|
||||
Images can be found a docker hub https://hub.docker.com/r/albrechtloh/qemu-openwrt
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
+3
-4
@@ -5,7 +5,7 @@ set -Eeuo pipefail
|
||||
|
||||
|
||||
APP="OpenWrt"
|
||||
SUPPORT="albrechtloh@gmx.de"
|
||||
SUPPORT="https://github.com/AlbrechtL/openwrt-docker-arm64-build"
|
||||
|
||||
attach_eth_if () {
|
||||
HOST_IF=$1
|
||||
@@ -75,8 +75,7 @@ if [ ! -e /dev/kvm ]; then
|
||||
fi
|
||||
fi
|
||||
if [ -n "$KVM_ERR" ]; then
|
||||
KVM="N"
|
||||
warning "KVM acceleration not detected $KVM_ERR, this will cause a major loss of performance."
|
||||
info "KVM acceleration not detected $KVM_ERR, this will cause a major loss of performance."
|
||||
fi
|
||||
|
||||
# Attach physical PHY to container
|
||||
@@ -114,7 +113,7 @@ info "Booting image using $VERS..."
|
||||
exec qemu-system-aarch64 -M virt \
|
||||
-m 128 \
|
||||
-nodefaults \
|
||||
$CPU_ARGS -smp 2 \
|
||||
$CPU_ARGS -smp $CPU_COUNT \
|
||||
-bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd \
|
||||
-display vnc=:0,websocket=5700 \
|
||||
-vga none -device ramfb \
|
||||
|
||||
@@ -16,6 +16,7 @@ echo
|
||||
|
||||
# Docker environment variables
|
||||
|
||||
: "${CPU_COUNT:=""}" # Physical LAN interface name
|
||||
: "${WAN_IF:=""}" # Physical WAN interface name
|
||||
: "${LAN_IF:=""}" # Physical LAN interface name
|
||||
: "${USB_VID_1:=""}" # USB vendor ID
|
||||
|
||||
Reference in New Issue
Block a user