|
| 1 | +# |
| 2 | +# This Dockerfile is for creating an image to bootstrap a container within which one or more |
| 3 | +# Silverpeas projects in developement can be built. It is expected the source code is shared |
| 4 | +# between the host (in which the IDE is running) and the container (in which the build is performed). |
| 5 | +# |
| 6 | +# By using such a container, we ensure the build is reproductible and doesn't depend on the |
| 7 | +# environment context specific to the developer's host. |
| 8 | +# |
| 9 | +FROM ubuntu:bionic |
| 10 | + |
| 11 | +LABEL name="Silverpeas Build" description="An image to build a Silverpeas project" vendor="Silverpeas" version=1 |
| 12 | +MAINTAINER Miguel Moquillon "miguel.moquillon@silverpeas.org" |
| 13 | + |
| 14 | +ENV TERM=xterm |
| 15 | + |
| 16 | +# Parameters whose values are required for the tests to succeed |
| 17 | +ARG DEFAULT_LOCALE=fr_FR.UTF-8 |
| 18 | +ARG MAVEN_VERSION=3.6.1 |
| 19 | +ARG MAVEN_SHA=b4880fb7a3d81edd190a029440cdf17f308621af68475a4fe976296e71ff4a4b546dd6d8a58aaafba334d309cc11e638c52808a4b0e818fc0fd544226d952544 |
| 20 | +ARG WILDFLY_VERSION=15.0.1 |
| 21 | +ARG JAVA_VERSION=8 |
| 22 | + |
| 23 | +# Because the source code is shared between the host and the container, it is required the identifier |
| 24 | +# of the owner is the same between this two environments. By default, it is set at 1000. |
| 25 | +ARG USER_ID=1000 |
| 26 | + |
| 27 | +COPY src/maven-deps.zip /tmp/ |
| 28 | + |
| 29 | +RUN apt-get update && apt-get install -y \ |
| 30 | + vim \ |
| 31 | + curl \ |
| 32 | + git \ |
| 33 | + openssh-client \ |
| 34 | + gnupg \ |
| 35 | + locales \ |
| 36 | + procps \ |
| 37 | + net-tools \ |
| 38 | + zip \ |
| 39 | + unzip \ |
| 40 | + openjdk-${JAVA_VERSION}-jdk \ |
| 41 | + ffmpeg \ |
| 42 | + imagemagick \ |
| 43 | + ghostscript \ |
| 44 | + libreoffice-writer \ |
| 45 | + libreoffice-calc \ |
| 46 | + libreoffice-impress \ |
| 47 | + gpgv \ |
| 48 | + && rm -rf /var/lib/apt/lists/* \ |
| 49 | + && update-ca-certificates -f \ |
| 50 | + && useradd -g users -u ${USER_ID} -d /home/silveruser -ms /bin/bash silveruser \ |
| 51 | + && mkdir -p /usr/share/maven /usr/share/maven/ref \ |
| 52 | + && curl -fsSL -o /tmp/apache-maven.tar.gz https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ |
| 53 | + && echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \ |
| 54 | + && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ |
| 55 | + && rm -f /tmp/apache-maven.tar.gz \ |
| 56 | + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \ |
| 57 | + && unzip /tmp/maven-deps.zip -d /home/silveruser/ \ |
| 58 | + && chown -R silveruser:users /home/silveruser/.m2 \ |
| 59 | + && curl -fsSL -o /tmp/swftools-bin-0.9.2.zip https://www.silverpeas.org/files/swftools-bin-0.9.2.zip \ |
| 60 | + && echo 'd40bd091c84bde2872f2733a3c767b3a686c8e8477a3af3a96ef347cf05c5e43 *swftools-bin-0.9.2.zip' | sha256sum - \ |
| 61 | + && unzip /tmp/swftools-bin-0.9.2.zip -d / \ |
| 62 | + && curl -fsSL -o /tmp/pdf2json-bin-0.68.zip https://www.silverpeas.org/files/pdf2json-bin-0.68.zip \ |
| 63 | + && echo 'eec849cdd75224f9d44c0999ed1fbe8764a773d8ab0cf7fff4bf922ab81c9f84 *pdf2json-bin-0.68.zip' | sha256sum - \ |
| 64 | + && unzip /tmp/pdf2json-bin-0.68.zip -d / \ |
| 65 | + && curl -fsSL -o /tmp/wildfly-${WILDFLY_VERSION}.Final.FOR-TESTS.zip https://www.silverpeas.org/files/wildfly-${WILDFLY_VERSION}.Final.FOR-TESTS.zip \ |
| 66 | + && mkdir /opt/wildfly-for-tests \ |
| 67 | + && unzip /tmp/wildfly-${WILDFLY_VERSION}.Final.FOR-TESTS.zip -d /opt/wildfly-for-tests/ \ |
| 68 | + && chown -R silveruser:users /opt/wildfly-for-tests/ \ |
| 69 | + && sed -i 's/\/home\/miguel\/tmp/\/opt\/wildfly-for-tests/g' /opt/wildfly-for-tests/wildfly-15.0.1.Final/standalone/configuration/standalone-full.xml \ |
| 70 | + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ |
| 71 | + && echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen \ |
| 72 | + && echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen \ |
| 73 | + && locale-gen \ |
| 74 | + && update-locale LANG=${DEFAULT_LOCALE} LANGUAGE=${DEFAULT_LOCALE} LC_ALL=${DEFAULT_LOCALE} |
| 75 | + |
| 76 | +COPY src/inputrc /home/silveruser/.inputrc |
| 77 | +COPY src/settings.xml /home/silveruser/.m2/ |
| 78 | + |
| 79 | +ENV LANG ${DEFAULT_LOCALE} |
| 80 | +ENV LANGUAGE ${DEFAULT_LOCALE} |
| 81 | +ENV LC_ALL ${DEFAULT_LOCALE} |
| 82 | +ENV MAVEN_HOME /usr/share/maven |
| 83 | + |
| 84 | +# By default, the build will be done in the default user's home directory |
| 85 | +USER silveruser |
| 86 | +WORKDIR /home/silveruser |
| 87 | + |
| 88 | +# The GPG and SSL keys to use for respectively signing and then deploying the built artifact to |
| 89 | +# our Nexus server have to to be provided by an outside directory; therefore the below definition |
| 90 | +# of volumes. |
| 91 | +# WARNING: You have to link also two files in order to be able to deploy the build results and to |
| 92 | +# push commits: |
| 93 | +# - /home/silveruser/.m2/settings.xml and /home/silveruser/.m2/settings-security.xml files with your |
| 94 | +# own in order to sign and to deploy the artifact with Maven. In these files the GPG key, the SSL |
| 95 | +# passphrase as well as the remote servers must be defined. |
| 96 | +# - /home/silveruser/.m2/.gitconfig file with your own in order to be able to push any commits. |
| 97 | +VOLUME ["/home/silveruser/.ssh", "/home/silveruser/.gnupg"] |
0 commit comments