nextcloud-fpm/patch-nextcloud.sh

18 lines
1.2 KiB
Bash
Raw Normal View History

2024-07-22 15:15:30 +02:00
#!/usr/bin/env sh
set -e
2024-09-24 21:49:59 +02:00
echo "==> starting patch script for nextcloud $NEXTCLOUD_VERSION"
echo "==> install git"
apt-get update -q && apt-get install -q -y git && rm -rf /var/lib/apt/lists
echo "==> clone nextcloud/docker"
2024-07-22 15:15:30 +02:00
git clone https://git.ar21.de/aaron/nextcloud-docker.git
2024-09-24 22:55:25 +02:00
# save current workdir
WORKDIR=$(pwd)
2024-09-24 21:49:59 +02:00
echo "==> patch the Dockerfile"
cd "nextcloud-docker/$NEXTCLOUD_VERSION/fpm/"
2024-07-22 16:32:04 +02:00
sed -i "$(awk '/^ENTRYPOINT /{line=NR} END{print line}' Dockerfile)s+^+# begin of patch\nRUN apt-get update\nRUN apt-get install -y libmagickcore-6.q16-6-extra tesseract-ocr tesseract-ocr-deu tesseract-ocr-eng ocrmypdf libbz2-dev\nRUN docker-php-ext-install bz2\nRUN apt-get clean autoclean\nRUN apt-get autoremove -y\nADD https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/deu.traineddata /usr/share/tesseract-ocr/tessdata/\nADD https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/eng.traineddata /usr/share/tesseract-ocr/tessdata/\n# end of patch\n+" Dockerfile
2024-09-24 21:49:59 +02:00
echo "==> determine tags"
2024-07-22 15:15:30 +02:00
full_version=$(grep -oP '(?<=^ENV NEXTCLOUD_VERSION ).*' Dockerfile)
2024-09-24 21:49:59 +02:00
echo "==> found $full_version"
2024-09-24 22:39:07 +02:00
echo "$full_version" > .tags
2024-09-24 22:55:25 +02:00
cd $WORKDIR
2024-09-24 22:39:07 +02:00
cp nextcloud-docker/$NEXTCLOUD_VERSION/fpm/* .