Skip to content

Commit

Permalink
Generate FSCrawler docker images
Browse files Browse the repository at this point in the history
* Generate FSCrawler docker images
* Use apt command and Specify libs version
* Skip the executions for IT
* Add a parameter to skip to build docker images.
* Add a new section about docker in getting_started
* Specify minor version to avoid OS version upgrade.
  • Loading branch information
toto1310 authored and dadoonet committed Mar 31, 2021
1 parent 1a538ef commit 68b29cb
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 0 deletions.
8 changes: 8 additions & 0 deletions distribution/es6/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<artifactId>fscrawler-es6</artifactId>
<name>FSCrawler ZIP Distribution for Elasticsearch 6.x</name>

<properties>
<module.name>es6</module.name>
</properties>

<dependencies>
<dependency>
<groupId>fr.pilato.elasticsearch.crawler</groupId>
Expand All @@ -25,6 +29,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
11 changes: 11 additions & 0 deletions distribution/es7/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<artifactId>fscrawler-es7</artifactId>
<name>FSCrawler ZIP Distribution for Elasticsearch 7.x</name>

<properties>
<module.name>es7</module.name>

<docker.eng.tags.0>latest</docker.eng.tags.0>
<docker.eng.tags.1>${project.version}</docker.eng.tags.1>
</properties>

<dependencies>
<dependency>
<groupId>fr.pilato.elasticsearch.crawler</groupId>
Expand All @@ -25,6 +32,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
207 changes: 207 additions & 0 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,54 @@
<module>es6</module>
</modules>

<properties>
<tesseract.version>3.04.*</tesseract.version>

<!-- Global configuration parameters for docker -->
<!-- By default, build docker images on each modules. -->
<docker.skip>${env.DOCKER_SKIP}</docker.skip>
<docker.verbose>build</docker.verbose>
<docker.username>dadoonet</docker.username>
<!-- The following assumes that each submodule will be overwritten. -->
<module.name>es7</module.name>

<!-- Docker Image Definitions -->
<!-- no install tesseract-ocr and data files for any languages -->
<docker.nolang.alias>${project.artifactId}-nolang</docker.nolang.alias>
<docker.nolang.name>${docker.username}/fscrawler:${project.version}-${module.name}-nolang</docker.nolang.name>
<docker.nolang.cacheFrom>${docker.nolang.name}</docker.nolang.cacheFrom>
<docker.nolang.dockerFile>${project.basedir}/../src/main/docker/Dockerfile</docker.nolang.dockerFile>
<docker.nolang.assembly.descriptor>${project.basedir}/../src/main/assembly/assembly.xml</docker.nolang.assembly.descriptor>
<docker.nolang.assembly.mode>tgz</docker.nolang.assembly.mode>

<!-- install tesseract-ocr and data files for English -->
<docker.eng.alias>${project.artifactId}-eng</docker.eng.alias>
<docker.eng.name>${docker.username}/fscrawler:${project.version}-${module.name}-eng</docker.eng.name>
<docker.eng.cacheFrom>${docker.eng.name}</docker.eng.cacheFrom>
<docker.eng.dockerFile>${docker.nolang.dockerFile}</docker.eng.dockerFile>
<docker.eng.assembly.descriptor>${docker.nolang.assembly.descriptor}</docker.eng.assembly.descriptor>
<docker.eng.assembly.mode>${docker.nolang.assembly.mode}</docker.eng.assembly.mode>
<docker.eng.args.langsPkg>tesseract-ocr=${tesseract.version} tesseract-ocr-eng=${tesseract.version}</docker.eng.args.langsPkg>

<!-- install tesseract-ocr and data files for Franch -->
<docker.fra.alias>${project.artifactId}-fra</docker.fra.alias>
<docker.fra.name>${docker.username}/fscrawler:${project.version}-${module.name}-fra</docker.fra.name>
<docker.fra.cacheFrom>${docker.fra.name}</docker.fra.cacheFrom>
<docker.fra.dockerFile>${docker.nolang.dockerFile}</docker.fra.dockerFile>
<docker.fra.assembly.descriptor>${docker.nolang.assembly.descriptor}</docker.fra.assembly.descriptor>
<docker.fra.assembly.mode>${docker.nolang.assembly.mode}</docker.fra.assembly.mode>
<docker.fra.args.langsPkg>tesseract-ocr=${tesseract.version} tesseract-ocr-fra=${tesseract.version}</docker.fra.args.langsPkg>

<!-- install tesseract-ocr and data files for Japanese -->
<docker.jpn.alias>${project.artifactId}-jpn</docker.jpn.alias>
<docker.jpn.name>${docker.username}/fscrawler:${project.version}-${module.name}-jpn</docker.jpn.name>
<docker.jpn.cacheFrom>${docker.jpn.name}</docker.jpn.cacheFrom>
<docker.jpn.dockerFile>${docker.nolang.dockerFile}</docker.jpn.dockerFile>
<docker.jpn.assembly.descriptor>${docker.nolang.assembly.descriptor}</docker.jpn.assembly.descriptor>
<docker.jpn.assembly.mode>${docker.nolang.assembly.mode}</docker.jpn.assembly.mode>
<docker.jpn.args.langsPkg>tesseract-ocr=${tesseract.version} tesseract-ocr-jpn=${tesseract.version}</docker.jpn.args.langsPkg>
</properties>

<dependencies>
<dependency>
<groupId>fr.pilato.elasticsearch.crawler</groupId>
Expand Down Expand Up @@ -109,6 +157,165 @@
</execution>
</executions>
</plugin>
<!-- Generate the docker images (run during package step) -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<!-- Disable configuration for IT -->
<images combine.self="override">
<image>
<external>
<type>properties</type>
<prefix>docker.nolang</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.eng</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.fra</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.jpn</prefix>
</external>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>start-elasticsearch</id>
<phase>none</phase>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>stop-elasticsearch</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- Generate the docker images (run during package step) -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<!-- Disable configuration for IT -->
<images combine.self="override">
<image>
<external>
<type>properties</type>
<prefix>docker.nolang</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.eng</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.fra</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.jpn</prefix>
</external>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>start-elasticsearch</id>
<phase>none</phase>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>stop-elasticsearch</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- Generate the docker images (run during package step) -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<!-- Disable configuration for IT -->
<images combine.self="override">
<image>
<external>
<type>properties</type>
<prefix>docker.nolang</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.eng</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.fra</prefix>
</external>
</image>
<image>
<external>
<type>properties</type>
<prefix>docker.jpn</prefix>
</external>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>start-elasticsearch</id>
<phase>none</phase>
</execution>
<execution>
<!-- There is no integration test so we can skip that execution -->
<id>stop-elasticsearch</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
16 changes: 16 additions & 0 deletions distribution/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:8u222-jdk

ARG langsPkg
RUN set -ex \
&& apt update \
&& apt install -y --no-install-recommends \
"gettext-base=0.19.*" \
${langsPkg} \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

COPY maven /usr/share/fscrawler
RUN set -ex \
&& ln -sn /usr/share/fscrawler/bin/fscrawler /usr/bin/

WORKDIR /usr/share/fscrawler
Loading

0 comments on commit 68b29cb

Please sign in to comment.