libsrt got packaged in Alpine Linux

This commit is contained in:
Yohann D'ANELLO 2020-09-29 14:22:56 +02:00
parent d46efaae3c
commit ae7dcf4221
2 changed files with 7 additions and 8 deletions

View File

@ -6,8 +6,7 @@ unit_tests:
image: golang:1.15-alpine image: golang:1.15-alpine
stage: test stage: test
before_script: before_script:
- apk add --no-cache git build-base tcl pkgconfig cmake libressl-dev linux-headers - apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libsrt-dev
- git clone --depth 1 --branch v1.4.2 https://github.com/Haivision/srt && cd srt && ./configure --enable-apps=OFF && make install && cd .. && rm -rf srt
script: script:
- go test -v -covermode=count -coverprofile cover.cov ./... - go test -v -covermode=count -coverprofile cover.cov ./...
- go tool cover -func=cover.cov - go tool cover -func=cover.cov

View File

@ -1,8 +1,8 @@
# Install dependencies, build libsrt then build ghostream # Install dependencies then build ghostream
FROM golang:1.15-alpine AS build_base FROM golang:1.15-alpine AS build_base
RUN apk add --no-cache git build-base tcl pkgconfig cmake libressl-dev linux-headers RUN apk add --no-cache build-base gcc
RUN git clone --depth 1 --branch v1.4.2 https://github.com/Haivision/srt && \ # libsrt is not yet packaged in community repository
cd srt && ./configure --enable-apps=OFF && make install && cd .. && rm -rf srt RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libsrt-dev
WORKDIR /code WORKDIR /code
COPY go.* ./ COPY go.* ./
RUN go mod download && go get github.com/markbates/pkger/cmd/pkger RUN go mod download && go get github.com/markbates/pkger/cmd/pkger
@ -11,9 +11,9 @@ RUN go generate && go build -o ./out/ghostream .
# Production image # Production image
FROM alpine:3.12 FROM alpine:3.12
RUN apk add ca-certificates libressl libstdc++ libgcc RUN apk add ca-certificates
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libsrt
COPY --from=build_base /code/out/ghostream /app/ghostream COPY --from=build_base /code/out/ghostream /app/ghostream
COPY --from=build_base /usr/local/lib64/libsrt.so.1 /lib/libsrt.so.1
WORKDIR /app WORKDIR /app
# 8080 for Web and Websocket, 2112 for prometheus monitoring and 9710 for SRT # 8080 for Web and Websocket, 2112 for prometheus monitoring and 9710 for SRT
EXPOSE 8080 2112 9710 EXPOSE 8080 2112 9710