mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
test environment for docker
This commit is contained in:
43
kvmd/testenv/Dockerfile
Normal file
43
kvmd/testenv/Dockerfile
Normal file
@@ -0,0 +1,43 @@
|
||||
FROM base/archlinux
|
||||
|
||||
RUN pacman -Syu --noconfirm \
|
||||
&& pacman -S --noconfirm \
|
||||
git \
|
||||
patch \
|
||||
make \
|
||||
fakeroot \
|
||||
binutils \
|
||||
expac \
|
||||
jshon \
|
||||
sudo \
|
||||
&& pacman -Sc --noconfirm
|
||||
|
||||
RUN useradd -r -d / packer \
|
||||
&& cd /tmp \
|
||||
&& sudo -u packer git clone https://aur.archlinux.org/packer-color.git \
|
||||
&& cd packer-color \
|
||||
&& sudo -u packer makepkg \
|
||||
&& pacman --noconfirm -U packer-color-*.pkg.tar.xz \
|
||||
&& ln -s /usr/bin/packer-color /usr/local/bin/packer \
|
||||
&& cp /usr/bin/packer-color /usr/local/bin/user-packer \
|
||||
&& sed -i -e "s|makepkg \$MAKEPKGOPTS |chown -R packer:packer \$dir; makepkg \$MAKEPKGOPTS |g" \
|
||||
/usr/local/bin/user-packer \
|
||||
&& sed -i -e "s|makepkg \$MAKEPKGOPTS --asroot -f|sudo -u packer makepkg \$MAKEPKGOPTS -f|g" \
|
||||
/usr/local/bin/user-packer \
|
||||
&& cd - \
|
||||
&& rm -rf /tmp/packer-color
|
||||
|
||||
RUN pacman -Syy \
|
||||
&& user-packer -S --noconfirm \
|
||||
python \
|
||||
python-pip \
|
||||
nginx \
|
||||
mjpg-streamer-pikvm \
|
||||
&& pacman -Sc --noconfirm
|
||||
|
||||
COPY testenv/requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
RUN dd if=/dev/zero of=/root/loop.img bs=1024 count=1048576
|
||||
|
||||
CMD /bin/bash
|
||||
73
kvmd/testenv/kvmd.yaml
Normal file
73
kvmd/testenv/kvmd.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
kvmd:
|
||||
server:
|
||||
host: 0.0.0.0
|
||||
port: 8081
|
||||
heartbeat: 3.0
|
||||
|
||||
keyboard:
|
||||
pinout:
|
||||
clock: 17
|
||||
data: 4
|
||||
|
||||
pulse: 0.0002
|
||||
|
||||
atx:
|
||||
pinout:
|
||||
power_led: 16
|
||||
hdd_led: 12
|
||||
power_switch: 26
|
||||
reset_switch: 20
|
||||
|
||||
click_delay: 0.1
|
||||
long_click_delay: 5.5
|
||||
|
||||
state_poll: 0.1
|
||||
|
||||
msd:
|
||||
device: "/dev/kvmd-msd"
|
||||
init_delay: 2.0
|
||||
write_meta: true
|
||||
chunk_size: 8192
|
||||
|
||||
streamer:
|
||||
pinout:
|
||||
cap: 21
|
||||
conv: 25
|
||||
|
||||
sync_delay: 1.0
|
||||
init_delay: 1.0
|
||||
shutdown_delay: 10.0
|
||||
|
||||
size:
|
||||
width: 720
|
||||
height: 576
|
||||
|
||||
cmd:
|
||||
- "/usr/bin/mjpg_streamer"
|
||||
- "-i"
|
||||
- "input_uvc.so -d /dev/kvmd-streamer -e 2 -y -n -r {width}x{height}"
|
||||
- "-o"
|
||||
- "output_http.so -l 0.0.0.0 -p 8082"
|
||||
|
||||
logging:
|
||||
version: 1
|
||||
disable_existing_loggers: false
|
||||
|
||||
formatters:
|
||||
console:
|
||||
(): logging.Formatter
|
||||
style: "{"
|
||||
datefmt: "%H:%M:%S"
|
||||
format: "[{asctime}] {name:20.20} {levelname:>7} --- {message}"
|
||||
|
||||
handlers:
|
||||
console:
|
||||
level: DEBUG
|
||||
class: logging.StreamHandler
|
||||
stream: ext://sys.stdout
|
||||
formatter: console
|
||||
|
||||
root:
|
||||
level: INFO
|
||||
handlers:
|
||||
- console
|
||||
7
kvmd/testenv/requirements.txt
Normal file
7
kvmd/testenv/requirements.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
git+git://github.com/willbuckner/rpi-gpio-development-mock@master#egg=rpi
|
||||
aiohttp
|
||||
aiofiles
|
||||
pyudev
|
||||
pyyaml
|
||||
bumpversion
|
||||
tox
|
||||
Reference in New Issue
Block a user