diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aedf901e..e7839f16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,9 +23,17 @@ jobs: choco install -y --no-progress gstreamer --version=1.20.0 choco install -y --no-progress gstreamer-devel --version=1.20.0 echo "Updating Cargo environment" - echo "C:\gstreamer\1.0\x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "c:\gstreamer\1.0\msvc_x86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "GSTREAMER_1_0_ROOT_X86_64=C:\gstreamer\1.0\x86_64\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + refreshenv + if (Test-Path -Path 'C:\gstreamer\1.0\msvc_x86_64\' -PathType Container) { + $env:GSTREAMER_1_0_ROOT_MSVC_X86_64='C:\gstreamer\1.0\msvc_x86_64\' + } elseif (Test-Path -Path 'D:\gstreamer\1.0\msvc_x86_64\' -PathType Container) { + $env:GSTREAMER_1_0_ROOT_MSVC_X86_64='D:\gstreamer\1.0\msvc_x86_64\' + } else { + throw "Cannot find gstreamer path" + } + echo "GSTREAMER_1_0_ROOT_MSVC_X86_64=$env:GSTREAMER_1_0_ROOT_MSVC_X86_64" + echo "GSTREAMER_1_0_ROOT_MSVC_X86_64=$env:GSTREAMER_1_0_ROOT_MSVC_X86_64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "$env:GSTREAMER_1_0_ROOT_MSVC_X86_64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - if: runner.os == 'macOS' name: Install Gstreamer on macOS run: | diff --git a/Dockerfile b/Dockerfile index 33c860c8..e45cbed1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,21 @@ # Neolink Docker image build scripts -# Copyright (c) 2020 George Hilliard +# Copyright (c) 2020 George Hilliard, +# Andrew King, +# Miroslav Šedivý # SPDX-License-Identifier: AGPL-3.0-only -FROM docker.io/rust:1-alpine AS build -MAINTAINER thirtythreeforty@gmail.com +FROM docker.io/rust:slim-buster AS build +LABEL authours="George Hilliard " -# Until Alpine merges gst-rtsp-server into a release, pull all Gstreamer packages -# from the "testing" release -RUN apk add --no-cache \ - -X http://dl-cdn.alpinelinux.org/alpine/edge/main \ - -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ - gst-rtsp-server-dev -RUN apk add --no-cache musl-dev gcc - -# Use static linking to work around https://github.com/rust-lang/rust/pull/58575 -ENV RUSTFLAGS='-C target-feature=-crt-static' +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + libgstrtspserver-1.0-dev \ + libgstreamer1.0-dev \ + libgtk2.0-dev \ + libglib2.0-dev && \ + apt-get clean -y && rm -rf /var/lib/apt/lists/* WORKDIR /usr/local/src/neolink @@ -23,19 +24,15 @@ COPY . /usr/local/src/neolink RUN cargo build --release # Create the release container. Match the base OS used to build -FROM docker.io/alpine:latest - -RUN apk add --no-cache \ - -X http://dl-cdn.alpinelinux.org/alpine/edge/main \ - -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ - libgcc \ - tzdata \ - gstreamer \ - gst-plugins-base \ - gst-plugins-good \ - gst-plugins-bad \ - gst-plugins-ugly \ - gst-rtsp-server +FROM debian:buster-slim + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libgstrtspserver-1.0-0 \ + libgstreamer1.0-0 \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad && \ + apt-get clean -y && rm -rf /var/lib/apt/lists/* COPY --from=build \ /usr/local/src/neolink/target/release/neolink \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d53714f0..b7a0171c 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -4,6 +4,6 @@ exit_func() { exit 1 } -trap exit_func SIGTERM SIGINT +trap exit_func TERM INT "$@"