-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
43 lines (31 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM docker.io/gcc:12 as build
RUN mkdir -p /build/src
RUN mkdir -p /build/out
COPY src/BambuP1Streamer.cpp /build/src/
COPY src/BambuTunnel.h /build/src/
RUN mkdir -p /build/deps
WORKDIR /build/deps
RUN curl -LOJ https://public-cdn.bambulab.com/upgrade/studio/plugins/01.04.00.15/linux_01.04.00.15.zip
RUN unzip linux_01.04.00.15.zip
RUN gcc /build/src/BambuP1Streamer.cpp -o /build/out/BambuP1Streamer
#ENV PRINTER_ADDRESS
#ENV PRINTER_ACCESS_CODE
FROM debian:12
RUN apt update && apt install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app
COPY --from=build /build/out/BambuP1Streamer /build/deps/libBambuSource.so /app/
RUN echo \
'streams:\n'\
' p1s: "exec:./BambuP1Streamer ./libBambuSource.so ${PRINTER_ADDRESS} ${PRINTER_ACCESS_CODE}"\n'\
'log:\n'\
' level: debug\n'\
'api:\n'\
' origin: "*"\n'\
> /app/go2rtc.yaml
WORKDIR /app
RUN curl -LOJ https://github.com/AlexxIT/go2rtc/releases/download/v1.6.2/go2rtc_linux_amd64
RUN chmod +x go2rtc_linux_amd64
WORKDIR /app
CMD [ "./go2rtc_linux_amd64" ]