forked from DDVTECH/mistserver
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
70 lines (43 loc) · 1.55 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
60
61
62
63
64
65
66
67
68
69
70
ARG STRIP_BINARIES="true"
ARG BUILD_VERSION="Unknown"
ARG BUILD_TARGET
FROM ubuntu:20.04 as mist-base
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /src
RUN apt update -yq \
&& apt install -yqq build-essential cmake git python3-pip libnss3-dev libssl-dev pkg-config \
&& pip3 install -U meson ninja
COPY . .
ARG BUILD_VERSION
ENV BUILD_VERSION="${BUILD_VERSION}"
RUN echo "${BUILD_VERSION}" > BUILD_VERSION
FROM mist-base as mist-static-build
WORKDIR /src
RUN meson setup -DNORIST=true -DLOAD_BALANCE=true -Dprefix=/opt --default-library static build \
&& cd build \
&& ninja \
&& ninja install
ARG STRIP_BINARIES
RUN if [ "$STRIP_BINARIES" = "true" ]; then find /opt/bin /opt/lib -type f -executable -exec strip -s {} \+; fi
FROM mist-base as mist-shared-build
WORKDIR /src
RUN meson setup -DNORIST=true -DLOAD_BALANCE=true -Dprefix=/opt build \
&& cd build \
&& ninja \
&& ninja install
ARG STRIP_BINARIES
RUN if [ "$STRIP_BINARIES" = "true" ]; then find /opt/bin /opt/lib -type f -executable -exec strip -s {} \+; fi
FROM mist-${BUILD_TARGET}-build as mist-build
FROM ubuntu:20.04 AS mist
LABEL maintainer="Amritanshu Varshney <[email protected]>"
ARG STRIP_BINARIES
ENV DEBIAN_FRONTEND=noninteractive
# Needed for working TLS
RUN apt update \
&& apt install -yqq ca-certificates musl "$(if [ "$STRIP_BINARIES" != "true" ]; then echo "gdb"; fi)" \
&& rm -rf /var/lib/apt/lists/*
COPY --from=mist-build /opt/ /usr/
ARG BUILD_VERSION
ENV BUILD_VERSION="${BUILD_VERSION}"
EXPOSE 1935 4242 8080 8889/udp
ENTRYPOINT ["/usr/bin/MistController"]