fix docker

This commit is contained in:
Leandro Moreira
2024-01-31 16:51:08 -03:00
parent 78b7381ff4
commit f83dfa2d62
3 changed files with 19 additions and 20 deletions

View File

@@ -1,7 +1,9 @@
FROM ubuntu:20.04 AS builder
FROM golang:1.19
ENV WD=/usr/src/app
ENV SRT_VERSION="v1.5.3"
ENV SRT_FOLDER="/opt/srt_lib"
WORKDIR ${WD}
RUN apt-get clean && apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
@@ -12,25 +14,18 @@ RUN \
mkdir -p "${SRT_FOLDER}" && \
git clone --depth 1 --branch "${SRT_VERSION}" https://github.com/Haivision/srt && \
cd srt && \
./configure --prefix=. $(configure) && \
./configure --prefix=${SRT_FOLDER} $(configure) && \
make && \
make install
FROM golang:1.19
ENV WD=/usr/src/app
WORKDIR ${WD}
RUN mkdir srt-lib
COPY --from=builder /srt /opt/srt
# To find where the srt.h and libsrt.so were you can
# find / -name srt.h
# find / -name libsrt.so
# inside the container docker run -it --rm -t <TAG_YOU_BUILT> bash
ENV GOPROXY=direct
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/srt/lib/"
ENV CGO_CFLAGS="-I/opt/srt/include/"
ENV CGO_LDFLAGS="-L/opt/srt/lib/"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${SRT_FOLDER}/lib/"
ENV CGO_CFLAGS="-I${SRT_FOLDER}/include/"
ENV CGO_LDFLAGS="-L${SRT_FOLDER}/lib/"
COPY . ./donut
WORKDIR ${WD}/donut

View File

@@ -1,7 +1,9 @@
FROM ubuntu:20.04 AS builder
FROM golang:1.19
ENV WD=/usr/src/app
ENV SRT_VERSION="v1.5.3"
ENV SRC_FOLDER="/opt/srt_lib"
ENV SRT_FOLDER="/opt/srt_lib"
WORKDIR ${WD}
RUN apt-get clean && apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
@@ -9,11 +11,12 @@ RUN apt-get clean && apt-get update && \
&& apt-get clean
RUN \
mkdir -p "${SRC_FOLDER}" && \
mkdir -p "${SRT_FOLDER}" && \
git clone --depth 1 --branch "${SRT_VERSION}" https://github.com/Haivision/srt && \
cd srt && \
./configure --prefix=. $(configure) && \
./configure --prefix=${SRT_FOLDER} $(configure) && \
make && \
make install
ENV PATH="${PATH}:/srt"
ENV PATH="${PATH}:/usr/src/app/srt"
WORKDIR ${WD}

View File

@@ -17,7 +17,8 @@ services:
context: .
dockerfile: Dockerfile-srt-live
entrypoint: sh
command: "./scripts/srt.sh"
command: "./srt.sh"
working_dir: "/scripts"
volumes:
- "./scripts:/scripts"
environment: