From da61998ad611bf25d5644223a82eed1cf2e3d835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Fri, 22 Feb 2019 13:52:32 +0100 Subject: [PATCH 1/2] Build releases without debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- Dockerfile | 1 + Dockerfile.arm | 1 + Dockerfile.arm64 | 1 + deployment/common.build.sh | 4 ++-- deployment/debian-package-x64/pkg-src/rules | 3 ++- deployment/fedora-package-x64/pkg-src/jellyfin.spec | 4 ++-- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 978b0d5409..af570ba655 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 RUN dotnet publish \ --configuration release \ --output /jellyfin \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ Jellyfin.Server FROM jellyfin/ffmpeg as ffmpeg diff --git a/Dockerfile.arm b/Dockerfile.arm index 9d1c30619b..9316245c50 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -21,6 +21,7 @@ RUN dotnet publish \ -r linux-arm \ --configuration release \ --output /jellyfin \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ Jellyfin.Server diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index e61aaa167c..5c67f85c9b 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -22,6 +22,7 @@ RUN dotnet publish \ -r linux-arm64 \ --configuration release \ --output /jellyfin \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ Jellyfin.Server diff --git a/deployment/common.build.sh b/deployment/common.build.sh index c191ec2a1b..5bffa1a732 100755 --- a/deployment/common.build.sh +++ b/deployment/common.build.sh @@ -36,9 +36,9 @@ build_jellyfin() echo -e "${CYAN}Building jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}" if [[ $DOTNETRUNTIME == 'framework' ]]; then - dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" + dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" else - dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME} + dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME} "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" fi EXIT_CODE=$? if [ $EXIT_CODE -eq 0 ]; then diff --git a/deployment/debian-package-x64/pkg-src/rules b/deployment/debian-package-x64/pkg-src/rules index ce98cb8f86..646f3621fe 100644 --- a/deployment/debian-package-x64/pkg-src/rules +++ b/deployment/debian-package-x64/pkg-src/rules @@ -16,7 +16,8 @@ override_dh_auto_test: override_dh_clistrip: override_dh_auto_build: - dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) Jellyfin.Server + dotnet publish --configuration $(CONFIG) --output='$(CURDIR)/usr/lib/jellyfin/bin' --self-contained --runtime $(DOTNETRUNTIME) \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server override_dh_auto_clean: dotnet clean -maxcpucount:1 --configuration $(CONFIG) Jellyfin.Server || true diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index 451a304b76..35045ee669 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -49,7 +49,8 @@ Jellyfin is a free software media system that puts you in control of managing an %install export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} Jellyfin.Server +dotnet publish --configuration Release --output='%{buildroot}%{_libdir}/jellyfin' --self-contained --runtime %{dotnet_runtime} \ + "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" Jellyfin.Server %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/%{name}/LICENSE %{__install} -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/override.conf %{__install} -D -m 0644 Jellyfin.Server/Resources/Configuration/logging.json %{buildroot}%{_sysconfdir}/%{name}/logging.json @@ -73,7 +74,6 @@ EOF %{_libdir}/%{name}/jellyfin-web/* %attr(755,root,root) %{_bindir}/%{name} %{_libdir}/%{name}/*.json -%{_libdir}/%{name}/*.pdb %{_libdir}/%{name}/*.dll %{_libdir}/%{name}/*.so %{_libdir}/%{name}/*.a From 38ec68c488c0c8e88989dc7c3fdc0824cfe71343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=BCttner?= Date: Sun, 24 Feb 2019 11:17:39 +0100 Subject: [PATCH 2/2] use common.build.sh for docker image builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Büttner --- Dockerfile | 7 ++----- Dockerfile.arm | 8 ++------ Dockerfile.arm64 | 8 ++------ deployment/common.build.sh | 3 +-- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index af570ba655..3562688419 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,8 @@ FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder WORKDIR /repo COPY . . ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 -RUN dotnet publish \ - --configuration release \ - --output /jellyfin \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ - Jellyfin.Server +RUN bash -c "source deployment/common.build.sh && \ + build_jellyfin Jellyfin.Server Release linux-x64 /jellyfin" FROM jellyfin/ffmpeg as ffmpeg FROM microsoft/dotnet:${DOTNET_VERSION}-runtime diff --git a/Dockerfile.arm b/Dockerfile.arm index 9316245c50..69c5d446e8 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -17,12 +17,8 @@ RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; # Discard objs - may cause failures if exists RUN find . -type d -name obj | xargs -r rm -r # Build -RUN dotnet publish \ - -r linux-arm \ - --configuration release \ - --output /jellyfin \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ - Jellyfin.Server +RUN bash -c "source deployment/common.build.sh && \ + build_jellyfin Jellyfin.Server Release linux-arm /jellyfin" FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm32v7 diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 5c67f85c9b..b85f8735bd 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -18,12 +18,8 @@ RUN find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; # Discard objs - may cause failures if exists RUN find . -type d -name obj | xargs -r rm -r # Build -RUN dotnet publish \ - -r linux-arm64 \ - --configuration release \ - --output /jellyfin \ - "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none" \ - Jellyfin.Server +RUN bash -c "source deployment/common.build.sh && \ + build_jellyfin Jellyfin.Server Release linux-arm64 /jellyfin" FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm64v8 diff --git a/deployment/common.build.sh b/deployment/common.build.sh index 5bffa1a732..d028e3a668 100755 --- a/deployment/common.build.sh +++ b/deployment/common.build.sh @@ -15,7 +15,6 @@ DEFAULT_CONFIG="Release" DEFAULT_OUTPUT_DIR="dist/jellyfin-git" DEFAULT_PKG_DIR="pkg-dist" DEFAULT_DOCKERFILE="Dockerfile" -DEFAULT_IMAGE_TAG="jellyfin:"`git rev-parse --abbrev-ref HEAD` DEFAULT_ARCHIVE_CMD="tar -xvzf" # Parse the version from the AssemblyVersion @@ -53,7 +52,7 @@ build_jellyfin_docker() ( BUILD_CONTEXT=${1-$DEFAULT_BUILD_CONTEXT} DOCKERFILE=${2-$DEFAULT_DOCKERFILE} - IMAGE_TAG=${3-$DEFAULT_IMAGE_TAG} + IMAGE_TAG=${3-"jellyfin:$(git rev-parse --abbrev-ref HEAD)"} echo -e "${CYAN}Building jellyfin docker image in '${BUILD_CONTEXT}' with Dockerfile '${DOCKERFILE}' and tag '${IMAGE_TAG}'.${NC}" docker build -t ${IMAGE_TAG} -f ${DOCKERFILE} ${BUILD_CONTEXT}