aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Büttner <thomas@vergesslicher.tech>2019-02-24 11:17:39 +0100
committerThomas Büttner <thomas@vergesslicher.tech>2019-02-24 11:17:39 +0100
commit38ec68c488c0c8e88989dc7c3fdc0824cfe71343 (patch)
treeffe0eed0f51de936e8ceee4f32514f421bafa252
parentda61998ad611bf25d5644223a82eed1cf2e3d835 (diff)
use common.build.sh for docker image builds
Signed-off-by: Thomas Büttner <thomas@vergesslicher.tech>
-rw-r--r--Dockerfile7
-rw-r--r--Dockerfile.arm8
-rw-r--r--Dockerfile.arm648
-rwxr-xr-xdeployment/common.build.sh3
4 files changed, 7 insertions, 19 deletions
diff --git a/Dockerfile b/Dockerfile
index af570ba65..356268841 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 9316245c5..69c5d446e 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 5c67f85c9..b85f8735b 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 5bffa1a73..d028e3a66 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}