-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathDockerfile
60 lines (48 loc) · 1.16 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
## Get Code and make
FROM debian:bookworm-slim AS build
ARG REPO=https://github.com/pikvm/ustreamer
ARG VERSION=master
WORKDIR /opt
RUN apt update \
&& apt install -y \
ca-certificates \
make \
gcc \
git \
libevent-dev \
libjpeg62-turbo-dev \
libbsd-dev \
libgpiod-dev \
pkg-config \
&& apt clean
RUN git clone ${REPO} ustreamer \
&& cd ustreamer \
&& git checkout ${VERSION} \
&& rm -rf .git
RUN cd ustreamer \
&& make LDFLAGS=-latomic
## Runtime Image
FROM debian:bookworm-slim AS run
RUN apt update \
&& apt install -y \
ca-certificates \
libevent-2.1-7 \
libevent-pthreads-2.1-7 \
libjpeg62-turbo \
libbsd0 \
libgpiod2 \
v4l-utils \
curl \
jq \
&& apt clean
WORKDIR /opt
RUN groupadd ustreamer --gid 1000 \
&& useradd ustreamer --uid 1000 --gid ustreamer \
&& usermod ustreamer --append --groups video
COPY --chown=ustreamer:ustreamer health.sh ./
COPY --chown=ustreamer:ustreamer --from=build /opt/ustreamer/src/ustreamer.bin ./ustreamer
## Start ustreamer
USER ustreamer
EXPOSE 8080
ENTRYPOINT ["/opt/ustreamer"]
CMD ["--host=0.0.0.0", "--port=8080"]