mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Improve sim container
This commit is contained in:
@@ -2,6 +2,7 @@ FROM python:3.10-alpine
|
|||||||
|
|
||||||
RUN mkdir /opt/dcc && pip -q install pyserial
|
RUN mkdir /opt/dcc && pip -q install pyserial
|
||||||
ADD net-to-serial.py config.ini /opt/dcc
|
ADD net-to-serial.py config.ini /opt/dcc
|
||||||
|
RUN python3 -q -m compileall /opt/dcc/net-to-serial.py
|
||||||
|
|
||||||
EXPOSE 2560/tcp
|
EXPOSE 2560/tcp
|
||||||
|
|
||||||
|
@@ -2,6 +2,6 @@ FROM dcc/net-to-serial
|
|||||||
|
|
||||||
RUN apk update && apk add qemu-system-avr && mkdir /io
|
RUN apk update && apk add qemu-system-avr && mkdir /io
|
||||||
ADD start.sh /opt/dcc
|
ADD start.sh /opt/dcc
|
||||||
ADD CommandStation-EX-uno-*.elf /io
|
ADD CommandStation-EX*.elf /io
|
||||||
|
|
||||||
ENTRYPOINT ["/opt/dcc/start.sh"]
|
ENTRYPOINT ["/opt/dcc/start.sh"]
|
||||||
|
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
PTY=0
|
PTY=0
|
||||||
|
|
||||||
|
# if container is run with -ti pts/0 is already taken
|
||||||
if [ -c /dev/pts/0 ]; then
|
if [ -c /dev/pts/0 ]; then
|
||||||
PTY=1
|
PTY=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s/ttyACM0/pts\/${PTY}/" /opt/dcc/config.ini
|
sed -i "s/ttyACM0/pts\/${PTY}/" /opt/dcc/config.ini
|
||||||
|
|
||||||
qemu-system-avr -machine uno -bios /io/CommandStation-EX-uno-*.elf -serial pty -daemonize
|
qemu-system-avr -machine uno -bios /io/CommandStation-EX*.elf -serial pty -daemonize
|
||||||
/opt/dcc/net-to-serial.py
|
/opt/dcc/net-to-serial.py
|
||||||
|
Reference in New Issue
Block a user