From 609b9e3369c844c6f6fd7f425a5c7f100ac3c16a Mon Sep 17 00:00:00 2001 From: Trenton Holmes Date: Sun, 24 Apr 2022 14:54:44 -0700 Subject: [PATCH] Adds utility script for building the Docker image locally --- build-docker-imaage.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 build-docker-imaage.sh diff --git a/build-docker-imaage.sh b/build-docker-imaage.sh new file mode 100755 index 000000000..7d097fe06 --- /dev/null +++ b/build-docker-imaage.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Example Usage: ./build-docker-imaage.sh -t paperless-ngx:my-awesome-feature + +set -eux + +# Parse what we can from Pipfile.lock +pikepdf_version=$(jq ".default.pikepdf.version" Pipfile.lock | sed 's/=//g' | sed 's/"//g') +psycopg2_version=$(jq ".default.psycopg2.version" Pipfile.lock | sed 's/=//g' | sed 's/"//g') + +# Get the branch name +frontend=$(git rev-parse --abbrev-ref HEAD) + +# Directly set these +# Future enhancement: Set this in a single location +qpdf_version="10.6.3" +jbig2enc_version="0.29" + +docker build . \ + --build-arg JBIG2ENC_VERSION="${jbig2enc_version}" \ + --build-arg QPDF_VERSION="${qpdf_version}" \ + --build-arg PIKEPDF_VERSION="${pikepdf_version}" \ + --build-arg PSYCOPG2_VERSION="${psycopg2_version}" \ + --build-arg FRONTEND_VERSION="${frontend}" "$@"