forked from voc/srtrelay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (35 loc) · 1.27 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
# syntax=docker/dockerfile:1
FROM golang:1.18-bullseye AS build
RUN apt-get update && \
apt-get upgrade -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install --no-install-recommends -y git tclsh pkg-config cmake libssl-dev build-essential ninja-build && \
git clone --depth 1 --branch v1.5.3 https://github.com/Haivision/srt.git libsrt && \
cmake -S libsrt -B libsrt-build -G Ninja && \
ninja -C libsrt-build && \
ninja -C libsrt-build install && \
rm -rf libsrt libsrt-build && \
apt-get purge -y git tclsh pkg-config cmake libssl-dev build-essential ninja-build && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY . /build
WORKDIR /build
ARG TARGETARCH
RUN GOOS=linux GOARCH=$TARGETARCH go build -ldflags="-w -s" -v -o srtrelay .
# clean start
FROM debian:bullseye
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y libssl1.1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN useradd -l -m -r srtrelay
USER srtrelay
WORKDIR /home/srtrelay/
COPY --from=build /build/config.toml.example ./config.toml
COPY --from=build /build/srtrelay ./
COPY --from=build /usr/local/lib/libsrt* /usr/lib/
CMD ["./srtrelay"]