Repository: incubator-metron Updated Branches: refs/heads/master b6786aaf0 -> 8c264f8e7
METRON-857 Metron should one unified docker build image (ottobackwards) closes apache/incubator-metron#543 Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/8c264f8e Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/8c264f8e Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/8c264f8e Branch: refs/heads/master Commit: 8c264f8e7345620c2a6c155d8d32e396ce30ec91 Parents: b6786aa Author: ottobackwards <[email protected]> Authored: Mon Apr 24 17:40:47 2017 -0400 Committer: otto <[email protected]> Committed: Mon Apr 24 17:40:47 2017 -0400 ---------------------------------------------------------------------- .../packaging/docker/ansible-docker/Dockerfile | 15 +- .../packaging/docker/rpm-docker/pom.xml | 137 +++++++++++++------ 2 files changed, 101 insertions(+), 51 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/8c264f8e/metron-deployment/packaging/docker/ansible-docker/Dockerfile ---------------------------------------------------------------------- diff --git a/metron-deployment/packaging/docker/ansible-docker/Dockerfile b/metron-deployment/packaging/docker/ansible-docker/Dockerfile index 1037bca..825e8a7 100644 --- a/metron-deployment/packaging/docker/ansible-docker/Dockerfile +++ b/metron-deployment/packaging/docker/ansible-docker/Dockerfile @@ -14,17 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM centos:6.6 +FROM centos:centos6 MAINTAINER Apache Metron RUN yum install -y tar RUN yum install -y wget RUN yum groupinstall -y "Development tools" RUN yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel libffi-devel -RUN wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz -O /usr/src/Python-2.7.10.tgz +RUN wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz -O /usr/src/Python-2.7.11.tgz WORKDIR /usr/src -RUN tar xvf Python-2.7.10.tgz -WORKDIR /usr/src/Python-2.7.10 +RUN tar xvf Python-2.7.11.tgz +WORKDIR /usr/src/Python-2.7.11 RUN ./configure RUN make altinstall WORKDIR /usr/src @@ -41,9 +41,10 @@ RUN yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel RUN yum install -y which RUN yum install -y nss WORKDIR /usr/src -RUN wget http://apache.cs.utah.edu/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz -RUN tar xzvf apache-maven-3.2.5-bin.tar.gz -RUN mv apache-maven-3.2.5 /opt/maven +RUN wget http://apache.cs.utah.edu/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz +RUN tar xzvf apache-maven-3.3.9-bin.tar.gz +RUN mv apache-maven-3.3.9 /opt/maven RUN ln -s /opt/maven/bin/mvn /usr/bin/mvn +RUN yum -y install asciidoc rpm-build rpm2cpio tar unzip xmlto zip rpmlint && yum clean all WORKDIR /root http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/8c264f8e/metron-deployment/packaging/docker/rpm-docker/pom.xml ---------------------------------------------------------------------- diff --git a/metron-deployment/packaging/docker/rpm-docker/pom.xml b/metron-deployment/packaging/docker/rpm-docker/pom.xml index aaede8d..dd1a995 100644 --- a/metron-deployment/packaging/docker/rpm-docker/pom.xml +++ b/metron-deployment/packaging/docker/rpm-docker/pom.xml @@ -89,50 +89,6 @@ </configuration> </plugin> <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.5.0</version> - <executions> - <execution> - <id>docker-build</id> - <phase>package</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <executable>docker</executable> - <arguments> - <argument>build</argument> - <argument>-f</argument> - <argument>Dockerfile</argument> - <argument>-t</argument> - <argument>${rpm.docker.tag}</argument> - <argument>.</argument> - </arguments> - </configuration> - </execution> - <execution> - <id>rpm-build</id> - <phase>package</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <executable>docker</executable> - <arguments> - <argument>run</argument> - <argument>-v</argument> - <argument>${project.basedir}:/root</argument> - <argument>${rpm.docker.tag}:latest</argument> - <argument>/bin/bash</argument> - <argument>-c</argument> - <argument>./build.sh ${project.version}</argument> - </arguments> - </configuration> - </execution> - </executions> - </plugin> - <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.1</version> <executions> @@ -227,4 +183,97 @@ </plugin> </plugins> </build> + <profiles> + <profile> + <id>InDocker</id> + <activation> + <file> + <!-- If this file exists, then we are running in docker already --> + <exists>/.dockerenv</exists> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.5.0</version> + <executions> + <execution> + <id>rpm-build</id> + <phase>package</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>/bin/bash</executable> + <arguments> + <argument>-c</argument> + <argument>./build.sh ${project.version}</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>NeedsDocker</id> + <activation> + <file> + <!-- if this file doesn't exist, then we need to run docker --> + <missing>/.dockerenv</missing> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.5.0</version> + <executions> + <execution> + <id>docker-build</id> + <phase>package</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>docker</executable> + <arguments> + <argument>build</argument> + <argument>-f</argument> + <argument>Dockerfile</argument> + <argument>-t</argument> + <argument>${rpm.docker.tag}</argument> + <argument>.</argument> + </arguments> + </configuration> + </execution> + <execution> + <id>rpm-build</id> + <phase>package</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>docker</executable> + <arguments> + <argument>run</argument> + <argument>-v</argument> + <argument>${project.basedir}:/root</argument> + <argument>${rpm.docker.tag}:latest</argument> + <argument>/bin/bash</argument> + <argument>-c</argument> + <argument>./build.sh ${project.version}</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project>
