|
| 1 | +FROM debian:jessie-backports |
| 2 | + |
| 3 | +MAINTAINER Miguel Moquillon "miguel.moquillon@silverpeas.org" |
| 4 | + |
| 5 | +LABEL name="Silverpeas 6" description="An all-to-one image to run Silverpeas 6 for testing purpose" vendor="Silverpeas" |
| 6 | + |
| 7 | +ARG SILVERPEAS_VERSION=6.0-SNAPSHOT |
| 8 | +ARG WILDFLY_VERSION=10.0.0 |
| 9 | +ARG DEFAULT_LOCALE=en_US.UTF-8 |
| 10 | + |
| 11 | +# |
| 12 | +# Check Silvereas and Wildfly at the asked version exist |
| 13 | +# |
| 14 | + |
| 15 | +RUN echo -n "Check build argument SILVERPEAS_VERSION: " && echo ${SILVERPEAS_VERSION} && test ! -z ${SILVERPEAS_VERSION} |
| 16 | +RUN echo -n "Check build argument WILDFLY_VERSION: " && echo ${WILDFLY_VERSION} && test ! -z ${WILDFLY_VERSION} |
| 17 | + |
| 18 | +RUN apt-get update && apt-get install -y wget |
| 19 | + |
| 20 | +RUN wget --spider https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip \ |
| 21 | + && wget --spider https://www.silverpeas.org/files/wildfly-${WILDFLY_VERSION}.Final.zip |
| 22 | + |
| 23 | +# |
| 24 | +# Install required and recommended programs for Silverpeas |
| 25 | +# |
| 26 | + |
| 27 | +# Installation of OpenJDK 8, ImageMagick, Ghostscript, LibreOffice, and then |
| 28 | +# the dependencies required to build SWFTools and PDF2JSON |
| 29 | +RUN apt-get update && apt-get install -y \ |
| 30 | + locales \ |
| 31 | + zip \ |
| 32 | + unzip \ |
| 33 | + openjdk-8-jdk \ |
| 34 | + build-essential \ |
| 35 | + autoconf \ |
| 36 | + zlib1g-dev \ |
| 37 | + libjpeg-dev \ |
| 38 | + libfreetype6-dev \ |
| 39 | + imagemagick \ |
| 40 | + ghostscript \ |
| 41 | + libreoffice \ |
| 42 | + ure \ |
| 43 | + gpgv \ |
| 44 | + && apt-get clean \ |
| 45 | + && rm -rf /var/lib/apt/lists/* \ |
| 46 | + && update-ca-certificates -f |
| 47 | + |
| 48 | +# Fetch the last stable version of SWFTools, build it and install it |
| 49 | +RUN wget -nc http://www.swftools.org/swftools-0.9.2.tar.gz \ |
| 50 | + && tar zxvf swftools-0.9.2.tar.gz \ |
| 51 | + && cd swftools-0.9.2 \ |
| 52 | + && ./configure \ |
| 53 | + && sed -i -e 's/rm -f $(pkgdatadir)\/swfs\/default_viewer.swf -o -L $(pkgdatadir)\/swfs\/default_viewer.swf/# rm -f $(pkgdatadir)\/swfs\/default_viewer.swf -o -L $(pkgdatadir)\/swfs\/default_viewer.swf/g' swfs/Makefile \ |
| 54 | + && sed -i -e 's/rm -f $(pkgdatadir)\/swfs\/default_loader.swf -o -L $(pkgdatadir)\/swfs\/default_loader.swf/# rm -f $(pkgdatadir)\/swfs\/default_loader.swf -o -L $(pkgdatadir)\/swfs\/default_loader.swf/g' swfs/Makefile \ |
| 55 | + && make && make install \ |
| 56 | + && cd .. \ |
| 57 | + && rm -rf swftools-0.9.2* |
| 58 | + |
| 59 | +# Fetch the last stable version of PDF2JSON, build it and install it |
| 60 | +RUN wget -nc https://github.com/flexpaper/pdf2json/releases/download/v0.68/pdf2json-0.68.tar.gz \ |
| 61 | + && mkdir pdf2json \ |
| 62 | + && tar zxvf pdf2json-0.68.tar.gz -C pdf2json \ |
| 63 | + && cd pdf2json \ |
| 64 | + && ./configure \ |
| 65 | + && make && make install \ |
| 66 | + && cd .. \ |
| 67 | + && rm -rf pdf2json* |
| 68 | + |
| 69 | +# |
| 70 | +# Set up environment to install and to run Silverpeas |
| 71 | +# |
| 72 | + |
| 73 | +# Generate locales and set the default one |
| 74 | +RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ |
| 75 | + && echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen \ |
| 76 | + && echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen \ |
| 77 | + && locale-gen \ |
| 78 | + && update-locale LANG=${DEFAULT_LOCALE} LANGUAGE=${DEFAULT_LOCALE} LC_ALL=${DEFAULT_LOCALE} |
| 79 | + |
| 80 | +ENV LANG ${DEFAULT_LOCALE} |
| 81 | +ENV LANGUAGE ${DEFAULT_LOCALE} |
| 82 | +ENV LC_ALL ${DEFAULT_LOCALE} |
| 83 | + |
| 84 | +# Set up environment variables for Silverpeas |
| 85 | +ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 |
| 86 | +ENV SILVERPEAS_HOME /opt/silverpeas |
| 87 | +ENV JBOSS_HOME /opt/wildfly |
| 88 | + |
| 89 | +# |
| 90 | +# Install Silverpeas and Wildfly |
| 91 | +# |
| 92 | + |
| 93 | +# Fetch both Silverpeas and Wildfly and unpack them into /opt |
| 94 | +RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip \ |
| 95 | + && wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip.asc \ |
| 96 | + && gpg --keyserver hkp://pgp.mit.edu --recv-keys 3DF442B6 \ |
| 97 | + && gpg --batch --verify silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip.asc silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip \ |
| 98 | + && wget -nc http://download.jboss.org/wildfly/${WILDFLY_VERSION}.Final/wildfly-${WILDFLY_VERSION}.Final.zip \ |
| 99 | + && unzip silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip -d /opt \ |
| 100 | + && unzip wildfly-${WILDFLY_VERSION}.Final.zip -d /opt \ |
| 101 | + && mv /opt/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?} /opt/silverpeas \ |
| 102 | + && mv /opt/wildfly-${WILDFLY_VERSION}.Final /opt/wildfly \ |
| 103 | + && rm *.zip \ |
| 104 | + && mkdir -p ${HOME}/.m2 \ |
| 105 | + |
| 106 | +# Copy the Maven settings.xml required to install Silverpeas by fetching the software bundles from |
| 107 | +# the Silverpeas Nexus Repository |
| 108 | +COPY settings.xml ${HOME}/.m2/ |
| 109 | + |
| 110 | +# Copy the database configuration parameters from which the global configuration config.properties |
| 111 | +# will be generated |
| 112 | +COPY db_config.properties ${SILVERPEAS_HOME}/configuration/ |
| 113 | +RUN cp ${SILVERPEAS_HOME}/configuration/db_config.properties ${SILVERPEAS_HOME}/configuration/config.properties |
| 114 | + |
| 115 | +# Set the default working directory |
| 116 | +WORKDIR ${SILVERPEAS_HOME}/bin |
| 117 | + |
| 118 | +# Copy this container init script that will be run each time the container is ran |
| 119 | +COPY run.sh /opt/ |
| 120 | +COPY ooserver /opt/ |
| 121 | + |
| 122 | +# Assemble the Silverpeas application with its working directories and marks it as ready to complete |
| 123 | +# the installation of Silverpeas in Wildfly at first run |
| 124 | +RUN ./silverpeas clean install \ |
| 125 | + && rm ../log/build-* |
| 126 | + |
| 127 | +# |
| 128 | +# Expose image entries. By default, when running, the container will set up Silverpeas and Wildfly |
| 129 | +# according to the host environment. |
| 130 | +# |
| 131 | + |
| 132 | +# Silverpeas listens port 8000 by default |
| 133 | +EXPOSE 8000 9990 |
| 134 | +# The following Silverpeas folders are exposed by default so that you can access the logs, the data, the properties |
| 135 | +# or the configuration of Silverpeas outside the container |
| 136 | +VOLUME ["/opt/silverpeas/log", "/opt/silverpeas/data", "/opt/silverpeas/h2"] |
| 137 | +ENTRYPOINT ["/opt/run.sh"] |
| 138 | +CMD ["configure", "start"] |
0 commit comments