From be7d2b068f61f4b0f8b71cc5e83843e89b5422fc Mon Sep 17 00:00:00 2001 From: Fabrice Gangler Date: Sun, 20 Nov 2016 07:08:37 +0100 Subject: [PATCH] Asqatasun/jdk-7/ and Asqatasun/jdk-8/ --- Asqatasun/jdk-7/Dockerfile | 58 ++++++++++++++++++++++++ Asqatasun/jdk-8/Dockerfile | 58 ++++++++++++++++++++++++ README.md | 91 ++++++++++++++++++++++++++++++++++---- 3 files changed, 198 insertions(+), 9 deletions(-) create mode 100644 Asqatasun/jdk-7/Dockerfile create mode 100644 Asqatasun/jdk-8/Dockerfile diff --git a/Asqatasun/jdk-7/Dockerfile b/Asqatasun/jdk-7/Dockerfile new file mode 100644 index 0000000..6fffccf --- /dev/null +++ b/Asqatasun/jdk-7/Dockerfile @@ -0,0 +1,58 @@ +FROM maven:3-jdk-7 +MAINTAINER Fabrice Gangler + +# ########################################################## +# +# DISCLAIMER +# +# #### usage ###################################################### +# +# --- BUILDING +# docker build -t asqa_mvn-jdk7 . +# docker build -t asqa_mvn-jdk7 --build-arg GIT_BRANCH=develop . +# +# --- TESTING +# docker run -it --rm asqa_mvn-jdk7 /bin/bash +# docker run -it --rm asqa_mvn-jdk7 javac -version +# docker run -it --rm asqa_mvn-jdk7 java -version +# docker run -it --rm asqa_mvn-jdk7 mvn -version +# docker run -it --rm asqa_mvn-jdk7 dpkg -l "openjdk*" +# +# --- COMPILING +# docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk7 mvn clean install +# docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk7 mvn clean +# +# +# #### source code ############################################### +# https://github.com/Asqatasun/Asqatasun/archive/master.zip +# overwriting with --build-arg GIT_BRANCH= +# +# #### FROM ###################################################### +# maven:3-jdk-7 https://github.com/carlossg/docker-maven/blob/master/jdk-7/Dockerfile +# |--- openjdk:7-jdk https://github.com/docker-library/openjdk/blob/master/7-jdk/Dockerfile +################################################################### + +# build variables +ARG SRC_URL_PREFIX=https://github.com/Asqatasun/Asqatasun/archive +ARG GIT_BRANCH=master + +ENV SRC_URL="${SRC_URL_PREFIX}/${GIT_BRANCH}.zip" +RUN cd /tmp/ && \ + wget ${SRC_URL} && \ + unzip ${GIT_BRANCH}.zip && \ + cd Asqatasun-${GIT_BRANCH} && \ + mvn clean install && \ + mv /root/.m2/repository /usr/share/maven/ref/repository && \ + rm -rf /tmp/*.zip /tmp/Asq* /root/.m2/* && \ + echo "\n\n\n" && \ + echo "-----> backup maven plugins : OK" && \ + echo "-----> clean : OK" && \ + echo "-----> configuration" && cd /root/ && \ + dpkg -l 'openjdk*'|grep ii && echo "-------------------" && \ + mvn -version && echo "----------------------------" && \ + javac -version && echo "----------------------------" && \ + java -version && echo "----------------------------" && \ + echo ${SRC_URL} && echo "----------------------------" + + + diff --git a/Asqatasun/jdk-8/Dockerfile b/Asqatasun/jdk-8/Dockerfile new file mode 100644 index 0000000..d401b42 --- /dev/null +++ b/Asqatasun/jdk-8/Dockerfile @@ -0,0 +1,58 @@ +FROM maven:3-jdk-8 +MAINTAINER Fabrice Gangler + +# ########################################################## +# +# DISCLAIMER +# +# #### usage ###################################################### +# +# --- BUILDING +# docker build -t asqa_mvn-jdk8 . +# docker build -t asqa_mvn-jdk8 --build-arg GIT_BRANCH=develop . +# +# --- TESTING +# docker run -it --rm asqa_mvn-jdk8 /bin/bash +# docker run -it --rm asqa_mvn-jdk8 javac -version +# docker run -it --rm asqa_mvn-jdk8 java -version +# docker run -it --rm asqa_mvn-jdk8 mvn -version +# docker run -it --rm asqa_mvn-jdk8 dpkg -l "openjdk*" +# +# --- COMPILING +# docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk8 mvn clean install +# docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk8 mvn clean +# +# +# #### source code ############################################### +# https://github.com/Asqatasun/Asqatasun/archive/master.zip +# overwriting with --build-arg GIT_BRANCH= +# +# #### FROM ###################################################### +# maven:3-jdk-8 https://github.com/carlossg/docker-maven/blob/master/jdk-8/Dockerfile +# |--- openjdk:8-jdk https://github.com/docker-library/openjdk/blob/master/8-jdk/Dockerfile +################################################################### + +# build variables +ARG SRC_URL_PREFIX=https://github.com/Asqatasun/Asqatasun/archive +ARG GIT_BRANCH=master + +ENV SRC_URL="${SRC_URL_PREFIX}/${GIT_BRANCH}.zip" +RUN cd /tmp/ && \ + wget ${SRC_URL} && \ + unzip ${GIT_BRANCH}.zip && \ + cd Asqatasun-${GIT_BRANCH} && \ + mvn clean install && \ + mv /root/.m2/repository /usr/share/maven/ref/repository && \ + rm -rf /tmp/*.zip /tmp/Asq* /root/.m2/* && \ + echo "\n\n\n" && \ + echo "-----> backup maven plugins : OK" && \ + echo "-----> clean : OK" && \ + echo "-----> configuration" && cd /root/ && \ + dpkg -l 'openjdk*'|grep ii && echo "-------------------" && \ + mvn -version && echo "----------------------------" && \ + javac -version && echo "----------------------------" && \ + java -version && echo "----------------------------" && \ + echo ${SRC_URL} && echo "----------------------------" + + + diff --git a/README.md b/README.md index 1dd2f16..258079d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,72 @@ ## Compilation déconnecté de l'OS via Docker ### Images Docker maven avec préchargement -@@@TODO DockerFile + +#### avec Java 7 (open-jdk7 + maven) + +##### builder l'image docker +```shell +git clone https://github.com/dzc34/asqatasun_docker.maven.git +cd asqatasun_docker.maven/Asqatasun/jdk-7 +docker build -t asqa_mvn-jdk7 . +docker build -t asqa_mvn-jdk7 --build-arg GIT_BRANCH=develop . +``` + +##### Contrôler l'image +```shell +docker run -it --rm asqa_mvn-jdk7 /bin/bash +docker run -it --rm asqa_mvn-jdk7 javac -version +docker run -it --rm asqa_mvn-jdk7 java -version +docker run -it --rm asqa_mvn-jdk7 mvn -version +docker run -it --rm asqa_mvn-jdk7 dpkg -l "openjdk*" +``` + +##### Compiler Asqatasun +```shell +git clone https://github.com/Asqatasun/Asqatasun.git +cd Asqatasun +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk7 mvn clean install +``` + +##### Nettoyer les dossiers de compilation +```shell +cd Asqatasun +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk7 mvn clean +``` + +#### avec Java 8 (open-jdk8 + maven) + +##### builder l'image docker +```shell +git clone https://github.com/dzc34/asqatasun_docker.maven.git +cd asqatasun_docker.maven/Asqatasun/jdk-8 +docker build -t asqa_mvn-jdk8 . +docker build -t asqa_mvn-jdk8 --build-arg GIT_BRANCH=develop . +``` + +##### Contrôler l'image +```shell +docker run -it --rm asqa_mvn-jdk8 /bin/bash +docker run -it --rm asqa_mvn-jdk8 javac -version +docker run -it --rm asqa_mvn-jdk8 java -version +docker run -it --rm asqa_mvn-jdk8 mvn -version +docker run -it --rm asqa_mvn-jdk8 dpkg -l "openjdk*" +``` + +##### Compiler Asqatasun +```shell +git clone https://github.com/Asqatasun/Asqatasun.git +cd Asqatasun +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk8 mvn clean install +``` + +##### Nettoyer les dossiers de compilation +```shell +cd Asqatasun +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ asqa_mvn-jdk8 mvn clean +``` + +------ ### Images Docker officielles de maven @@ -15,18 +80,26 @@ ```shell docker pull maven:3-jdk-7 ``` +##### Tester l'image en ouvrant un shell +```shell +docker run -it --rm maven:3-jdk-8 /bin/bash +``` +##### Afficher la version du compilateur java +```shell +docker run -it --rm maven:3-jdk-8 javac -version +``` ##### Compiler ```shell -git clone (...) +git clone https://github.com/Asqatasun/Asqatasun.git cd Asqatasun -docker run -it --rm --name mvn-jdk7 -v "$PWD":/usr/src/asqa -w /usr/src/asqa maven:3-jdk-7 mvn clean install +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ maven:3-jdk-7 mvn clean install ``` -##### Nettoyer +##### Nettoyer les dossiers de compilation ```shell cd Asqatasun -docker run -it --rm --name mvn-jdk7 -v "$PWD":/usr/src/asqa -w /usr/src/asqa maven:3-jdk-7 mvn clean +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ maven:3-jdk-7 mvn clean ``` #### avec Java 8 (open-jdk8 + maven) @@ -36,15 +109,15 @@ docker pull maven:3-jdk-8 ##### Compiler ```shell -git clone (...) +git clone https://github.com/Asqatasun/Asqatasun.git cd Asqatasun -docker run -it --rm --name mvn-jdk8 -v "$PWD":/usr/src/asqa -w /usr/src/asqa maven:3-jdk-8 mvn clean install +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ maven:3-jdk-8 mvn clean install ``` -##### Nettoyer +##### Nettoyer les dossiers de compilation ```shell cd Asqatasun -docker run -it --rm --name mvn-jdk8 -v "$PWD":/usr/src/asqa -w /usr/src/asqa maven:3-jdk-8 mvn clean +docker run -it --rm -v "$PWD":/usr/src/ -w /usr/src/ maven:3-jdk-8 mvn clean ``` ## Contact and discussions