Skip to content

Commit 548b523

Browse files
committed
Solved compatibility problems, minified image and reduced loading time using buildx
1 parent a28a85f commit 548b523

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM ubuntu
1+
FROM bitnami/minideb:stretch
22

33
ARG DEBIAN_FRONTEND=noninteractive
4-
RUN apt-get -y update
5-
RUN apt-get -y install wget udev libfontconfig xorg openbox build-essential xz-utils
6-
RUN wget https://downloads.arduino.cc/arduino-1.8.15-linux64.tar.xz
7-
RUN wget https://www.pjrc.com/teensy/td_154/TeensyduinoInstall.linux64
8-
RUN wget https://www.pjrc.com/teensy/00-teensy.rules
4+
#RUN apt-get -y update
5+
RUN install_packages curl udev libfontconfig xorg openbox build-essential xz-utils ca-certificates
6+
RUN curl https://downloads.arduino.cc/arduino-1.8.15-linux64.tar.xz -o arduino-1.8.15-linux64.tar.xz
7+
RUN curl https://www.pjrc.com/teensy/td_154/TeensyduinoInstall.linux64 -o TeensyduinoInstall.linux64
8+
RUN curl https://www.pjrc.com/teensy/00-teensy.rules -o 00-teensy.rules
99
RUN cp ./00-teensy.rules /etc/udev/rules.d/
1010
RUN tar -xavf arduino-1.8.15-linux64.tar.xz
1111
RUN chmod 755 TeensyduinoInstall.linux64
1212
RUN ./TeensyduinoInstall.linux64 --dir=arduino-1.8.15
1313

14-
CMD xauth add ${TOKEN} && ./arduino-1.8.15/arduino
14+
CMD ulimit -n 10000 && xauth add ${TOKEN} && ./arduino-1.8.15/arduino

teensyduino.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@
2929
with open(".env","w") as f:
3030
f.write(f"TOKEN={token}")
3131

32-
docker.compose.build()
32+
def resource_path(relative_path):
33+
""" Get absolute path to resource, works for dev and for PyInstaller """
34+
try:
35+
# PyInstaller creates a temp folder and stores path in _MEIPASS
36+
base_path = sys._MEIPASS
37+
except Exception:
38+
base_path = os.path.abspath(".")
39+
40+
return os.path.join(base_path, relative_path)
41+
42+
43+
docker.buildx.build(resource_path("."))
3344

3445
docker.compose.config()
3546

0 commit comments

Comments
 (0)