ATS-986: Experiment to switch Java Base Image (from CentOS 7 to Rocky Linux 8)

- temporarily downgrade from I/M 7.1.0-16 to 7.1.0-7
- TODO fix I/M rpm build scripts for "linux" (for CentOS 8 / Rocky Linux 8)
- TODO upload built rpms to Nexus
This commit is contained in:
Jan Vonka
2022-03-19 15:59:15 +00:00
parent 4c19b815a0
commit 7d97384778
9 changed files with 55 additions and 40 deletions

View File

@@ -5,16 +5,17 @@
# ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt. # ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt.
# alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt. # alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt.
FROM alfresco/alfresco-base-java:jre11-centos7-202203101229 FROM alfresco/alfresco-base-java:jre11-rockylinux8-202203101229
ARG EXIFTOOL_VERSION=12.25 ARG EXIFTOOL_VERSION=12.25
ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION} ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION}
ARG EXIFTOOL_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/exiftool/image-exiftool/${EXIFTOOL_VERSION}/image-exiftool-${EXIFTOOL_VERSION}.tgz ARG EXIFTOOL_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/exiftool/image-exiftool/${EXIFTOOL_VERSION}/image-exiftool-${EXIFTOOL_VERSION}.tgz
ARG IMAGEMAGICK_VERSION=7.1.0-16 # TODO ATS-986 - update to 7.1.0-16 (once "imgemagick-distribution/7.1.0-16-linux.rpm" and "imgemagick-distribution/7.1.0-16-libs-linux.rpm" available in Nexus)
ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-centos7.rpm ARG IMAGEMAGICK_VERSION=7.1.0-7
ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-libs-centos7.rpm ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-linux.rpm
ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-libs-linux.rpm
ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
ARG LIBREOFFICE_VERSION=7.2.5 ARG LIBREOFFICE_VERSION=7.2.5
ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/${LIBREOFFICE_VERSION}/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz ENV LIBREOFFICE_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/libreoffice/libreoffice-dist/${LIBREOFFICE_VERSION}/libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz
@@ -33,7 +34,8 @@ COPY target/alfresco-transform-core-aio-boot-${env.project_version}.jar /usr/bin
RUN ln /usr/bin/alfresco-transform-core-aio-boot-${env.project_version}.jar /usr/bin/alfresco-transform-core-aio-boot.jar && \ RUN ln /usr/bin/alfresco-transform-core-aio-boot-${env.project_version}.jar /usr/bin/alfresco-transform-core-aio-boot.jar && \
yum install -y $IMAGEMAGICK_DEP_RPM_URL && \ yum install -y $IMAGEMAGICK_DEP_RPM_URL && \
yum install -y $IMAGEMAGICK_LIB_RPM_URL $IMAGEMAGICK_RPM_URL && \ yum install -y $IMAGEMAGICK_LIB_RPM_URL && \
yum install -y $IMAGEMAGICK_RPM_URL && \
yum install -y cairo cups-libs libSM libGLU && \ yum install -y cairo cups-libs libSM libGLU && \
test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \ test -f libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz && \
ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \ ln -s libreoffice-dist-${LIBREOFFICE_VERSION}-linux.gz libreoffice-dist-linux.gz || \

View File

@@ -2,13 +2,14 @@
# ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt. # ImageMagick is from ImageMagick Studio LLC. See the license at http://www.imagemagick.org/script/license.php or in /ImageMagick-license.txt.
FROM alfresco/alfresco-base-java:jre11-centos7-202203101229 FROM alfresco/alfresco-base-java:jre11-rockylinux8-202203101229
ARG IMAGEMAGICK_VERSION=7.1.0-16 # TODO ATS-986 - update to 7.1.0-16 (once "imgemagick-distribution/7.1.0-16-linux.rpm" and "imgemagick-distribution/7.1.0-16-libs-linux.rpm" available in Nexus)
ARG IMAGEMAGICK_VERSION=7.1.0-7
ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-centos7.rpm ENV IMAGEMAGICK_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-linux.rpm
ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-libs-centos7.rpm ENV IMAGEMAGICK_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/content/org/imagemagick/imagemagick-distribution/${IMAGEMAGICK_VERSION}/imagemagick-distribution-${IMAGEMAGICK_VERSION}-libs-linux.rpm
ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
ENV JAVA_OPTS="" ENV JAVA_OPTS=""
# Set default user information # Set default user information
@@ -21,7 +22,8 @@ COPY target/${env.project_artifactId}-${env.project_version}.jar /usr/bin
RUN ln /usr/bin/${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.project_artifactId}.jar && \ RUN ln /usr/bin/${env.project_artifactId}-${env.project_version}.jar /usr/bin/${env.project_artifactId}.jar && \
yum install -y $IMAGEMAGICK_DEP_RPM_URL && \ yum install -y $IMAGEMAGICK_DEP_RPM_URL && \
yum install -y $IMAGEMAGICK_LIB_RPM_URL $IMAGEMAGICK_RPM_URL && \ yum install -y $IMAGEMAGICK_LIB_RPM_URL && \
yum install -y $IMAGEMAGICK_RPM_URL && \
yum clean all yum clean all
ADD target/generated-resources/licenses /licenses ADD target/generated-resources/licenses /licenses

View File

@@ -1,16 +0,0 @@
# How to create ImageMagick RPM packages for CentOS 7
1. `cd` to this directory
2. Use CentOS 7 base image and execute the [build-rpms.sh](scripts/build-rpms.sh) script
```bash
docker run -it --rm -v `pwd`:/opt/alfresco/imagemagick alfresco/alfresco-base-java:11.0.13-centos-7@sha256:c1e399d1bbb5d08e0905f1a9ef915ee7c5ea0c0ede11cc9bd7ca98532a9b27fa /bin/bash /opt/alfresco/imagemagick/scripts/build-rpms.sh
```
> **Note:** If you want to know more details or need to upgrade the ImageMagick version please check the comments in the [build-rpms.sh](scripts/build-rpms.sh) file
3. RPMs will be created in the `rpms` directory
```bash
bash-3.2$ ls rpms
ImageMagick-7.0.10-59.x86_64.centos7.rpm ImageMagick-libs-7.0.10-59.x86_64.centos7.rpm
```

View File

@@ -0,0 +1,16 @@
# How to create ImageMagick RPM packages for Linux (eg. CentOS 8 / Rocky Linux 8)
1. `cd` to this directory
2. Use Rocky Linux 8 base image and execute the [build-rpms.sh](scripts/build-rpms.sh) script
```bash
docker run -it --rm -v `pwd`:/opt/alfresco/imagemagick alfresco/alfresco-base-java:jre11-rockylinux8-202203101229 /bin/bash /opt/alfresco/imagemagick/build-rpms.sh
```
> **Note:** If you want to know more details or need to upgrade the ImageMagick version please check the comments in the [build-rpms.sh](scripts/build-rpms.sh) file
3. RPMs will be created in the `rpms` directory
```bash
bash-3.2$ ls rpms
ImageMagick-7.1.0-16.x86_64.linux.rpm ImageMagick-libs-7.1.0-10.x86_64.linux.rpm
```

View File

@@ -2,6 +2,14 @@
set -e set -e
# TODO ATS-986 - below is an untested & incomplete example - will need fixing !
# Package zlib-devel-1.2.11-17.el8.x86_64 is already installed.
# Error:
# Problem: cannot install the best candidate for the job
# - nothing provides libxml2(x86-64) = 2.9.7-12.el8_5 needed by libxml2-devel-2.9.7-12.el8_5.x86_64
# (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
IMAGEMAGICK_VERSION=7.1.0-16 IMAGEMAGICK_VERSION=7.1.0-16
#Installing SRPM package. For future proof builds the SRPM package is uploaded to Alfresco's nexus repository. #Installing SRPM package. For future proof builds the SRPM package is uploaded to Alfresco's nexus repository.
@@ -11,18 +19,21 @@ rpm -i https://nexus.alfresco.com/nexus/service/local/repositories/thirdparty/co
sed -i '/lqr/d' ~/rpmbuild/SPECS/ImageMagick.spec sed -i '/lqr/d' ~/rpmbuild/SPECS/ImageMagick.spec
#We need some libraries from the epel repo. #We need some libraries from the epel repo.
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
#We are going to compile the imagemagick so we need development tools. #We are going to compile the imagemagick so we need development tools.
yum -y group install "Development Tools" yum -y group install "Development Tools"
yum install dnf-plugins-core
yum config-manager --set-enabled powertools
#We are building the imagemagick from the official SRPM package. It allows us to be as compatible with the official RPM packages as possible. #We are building the imagemagick from the official SRPM package. It allows us to be as compatible with the official RPM packages as possible.
# Installing direct build time dependencies (excluding liblqr-1-devel) # Installing direct build time dependencies (excluding liblqr-1-devel)
yum -y install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel \ yum -y install freetype-devel libjpeg-devel jasper-devel libpng-devel bzip2-devel libtiff-devel \
zlib-devel perl-devel perl-generators ghostscript-devel djvulibre-devel libwmf-devel jasper-devel \ giflib-devel zlib-devel ghostscript-devel libwmf-devel librsvg2-devel \
libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms2-devel libxml2-devel librsvg2-devel \ libtool-ltdl-devel libX11-devel libXext-devel libXt-devel libxml2-devel OpenEXR-devel php-devel
fftw-devel ilmbase-devel OpenEXR-devel libwebp-devel jbigkit-devel openjpeg2-devel graphviz-devel \
libraqm-devel LibRaw-devel
# Installing indirect dependencies # Installing indirect dependencies
# ImageMagick tests requite non default fonts # ImageMagick tests requite non default fonts
yum groupinstall -y "fonts" yum groupinstall -y "fonts"
@@ -34,5 +45,5 @@ rpmbuild -bb ~/rpmbuild/SPECS/ImageMagick.spec
#Copy RPMs to well known directory. #Copy RPMs to well known directory.
mkdir -p /opt/alfresco/imagemagick/rpms mkdir -p /opt/alfresco/imagemagick/rpms
cp ~/rpmbuild/RPMS/x86_64/ImageMagick-$IMAGEMAGICK_VERSION.x86_64.rpm /opt/alfresco/imagemagick/rpms/ImageMagick-$IMAGEMAGICK_VERSION.x86_64.centos7.rpm cp ~/rpmbuild/RPMS/x86_64/ImageMagick-$IMAGEMAGICK_VERSION.x86_64.rpm /opt/alfresco/imagemagick/rpms/ImageMagick-$IMAGEMAGICK_VERSION.x86_64.linux.rpm
cp ~/rpmbuild/RPMS/x86_64/ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.rpm /opt/alfresco/imagemagick/rpms/ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.centos7.rpm cp ~/rpmbuild/RPMS/x86_64/ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.rpm /opt/alfresco/imagemagick/rpms/ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.linux.rpm

View File

@@ -2,7 +2,7 @@
# LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt. # LibreOffice is from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt.
FROM alfresco/alfresco-base-java:jre11-centos7-202203101229 FROM alfresco/alfresco-base-java:jre11-rockylinux8-202203101229
ARG LIBREOFFICE_VERSION=7.2.5 ARG LIBREOFFICE_VERSION=7.2.5

View File

@@ -1,6 +1,6 @@
# Image provides a container in which to run miscellaneous transformations for Alfresco Content Services. # Image provides a container in which to run miscellaneous transformations for Alfresco Content Services.
FROM alfresco/alfresco-base-java:jre11-centos7-202203101229 FROM alfresco/alfresco-base-java:jre11-rockylinux8-202203101229
ENV JAVA_OPTS="" ENV JAVA_OPTS=""

View File

@@ -2,7 +2,7 @@
# alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt. # alfresco-pdf-renderer uses the PDFium library from Google Inc. See the license at https://pdfium.googlesource.com/pdfium/+/master/LICENSE or in /pdfium.txt.
FROM alfresco/alfresco-base-java:jre11-centos7-202203101229 FROM alfresco/alfresco-base-java:jre11-rockylinux8-202203101229
ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz ENV ALFRESCO_PDF_RENDERER_LIB_RPM_URL=https://nexus.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.1/alfresco-pdf-renderer-1.1-linux.tgz
ENV JAVA_OPTS="" ENV JAVA_OPTS=""

View File

@@ -2,7 +2,7 @@
# Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0. # Tika is from Apache. See the license at http://www.apache.org/licenses/LICENSE-2.0.
FROM alfresco/alfresco-base-java:jre11-centos7-202203101229 FROM alfresco/alfresco-base-java:jre11-rockylinux8-202203101229
ARG EXIFTOOL_VERSION=12.25 ARG EXIFTOOL_VERSION=12.25
ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION} ARG EXIFTOOL_FOLDER=Image-ExifTool-${EXIFTOOL_VERSION}