From c0bd4f3bef82a358eef5d642f27f543fecd1018b Mon Sep 17 00:00:00 2001 From: Danius Michaelides Date: Sun, 28 Apr 2019 11:48:33 +0100 Subject: [PATCH 1/3] Builds in docker container --- .dockerignore | 6 ++++++ .gitignore | 1 + Dockerfile | 32 ++++++++++++++++++++++++++++++++ Makefile-docker | 9 +++++++++ 4 files changed, 48 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Makefile-docker diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..f75ed6a14 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.gitignore +.dockerignore +README.md +TODO.txt +provconvert* diff --git a/.gitignore b/.gitignore index 9462d04e9..8be9f795b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ target/ .classpath *.classpath *.DS_Store +provconvert*.zip diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..a1077b064 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM maven:3.6-alpine + +RUN apk update && apk add graphviz man rpm python cdrkit + +WORKDIR /src + +COPY pom.xml /src/ +COPY prov-dot/pom.xml /src/prov-dot/ +COPY prov-generator/pom.xml /src/prov-generator/ +COPY prov-interop/pom.xml /src/prov-interop/ +COPY prov-json/pom.xml /src/prov-json/ +COPY prov-model/pom.xml /src/prov-model/ +COPY prov-n/pom.xml /src/prov-n/ +COPY prov-rdf/pom.xml /src/prov-rdf/ +COPY prov-sql/pom.xml /src/prov-sql/ +COPY prov-template/pom.xml /src/prov-template/ +COPY prov-xml/pom.xml /src/prov-xml/ +COPY toolbox/pom.xml /src/toolbox/ + +COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial1/pom.xml +COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial2/pom.xml +COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial3/pom.xml +COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial4/pom.xml +COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial5/pom.xml +COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial6/pom.xml + +RUN mvn -f pom.xml dependency:resolve --fail-never + +COPY . /src + +RUN mvn package + diff --git a/Makefile-docker b/Makefile-docker new file mode 100644 index 000000000..13be0882f --- /dev/null +++ b/Makefile-docker @@ -0,0 +1,9 @@ +build: + docker build -t provtoolboxbuild . + +extract: + docker run --name extract --rm provtoolboxbuild sleep 1000 & + sleep 5 + -docker cp extract:/src/toolbox/target/provconvert-0.7.4-SNAPSHOT-release.zip . + docker kill extract + [ -e provconvert-0.7.4-SNAPSHOT-release.zip ] From 29b100932560bdea422b3288798d50dd50c0f727 Mon Sep 17 00:00:00 2001 From: Danius Michaelides Date: Sun, 19 May 2019 17:54:29 +0100 Subject: [PATCH 2/3] Corrects Dockerfile tutorial copying --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a1077b064..f0270bbf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,11 +18,11 @@ COPY prov-xml/pom.xml /src/prov-xml/ COPY toolbox/pom.xml /src/toolbox/ COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial1/pom.xml -COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial2/pom.xml -COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial3/pom.xml -COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial4/pom.xml -COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial5/pom.xml -COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial6/pom.xml +COPY ./tutorial/tutorial2/pom.xml /src/tutorial/tutorial2/pom.xml +COPY ./tutorial/tutorial3/pom.xml /src/tutorial/tutorial3/pom.xml +COPY ./tutorial/tutorial4/pom.xml /src/tutorial/tutorial4/pom.xml +COPY ./tutorial/tutorial5/pom.xml /src/tutorial/tutorial5/pom.xml +COPY ./tutorial/tutorial6/pom.xml /src/tutorial/tutorial6/pom.xml RUN mvn -f pom.xml dependency:resolve --fail-never From 39d7120e86e149088ebf542eaa6bd5d32b4e32b9 Mon Sep 17 00:00:00 2001 From: Danius Michaelides Date: Sun, 6 Oct 2019 10:07:51 +0100 Subject: [PATCH 3/3] Updates build for new layout --- Dockerfile | 69 ++++++++++++++++++++++++++++++++----------------- Makefile-docker | 6 ++--- 2 files changed, 49 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0270bbf8..d0b788060 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,55 @@ -FROM maven:3.6-alpine +FROM maven:3.6-jdk-11-slim -RUN apk update && apk add graphviz man rpm python cdrkit +RUN apt-get update && apt-get -y install graphviz man rpm python rubygems make && gem install json-ld WORKDIR /src COPY pom.xml /src/ -COPY prov-dot/pom.xml /src/prov-dot/ -COPY prov-generator/pom.xml /src/prov-generator/ -COPY prov-interop/pom.xml /src/prov-interop/ -COPY prov-json/pom.xml /src/prov-json/ -COPY prov-model/pom.xml /src/prov-model/ -COPY prov-n/pom.xml /src/prov-n/ -COPY prov-rdf/pom.xml /src/prov-rdf/ -COPY prov-sql/pom.xml /src/prov-sql/ -COPY prov-template/pom.xml /src/prov-template/ -COPY prov-xml/pom.xml /src/prov-xml/ -COPY toolbox/pom.xml /src/toolbox/ - -COPY ./tutorial/tutorial1/pom.xml /src/tutorial/tutorial1/pom.xml -COPY ./tutorial/tutorial2/pom.xml /src/tutorial/tutorial2/pom.xml -COPY ./tutorial/tutorial3/pom.xml /src/tutorial/tutorial3/pom.xml -COPY ./tutorial/tutorial4/pom.xml /src/tutorial/tutorial4/pom.xml -COPY ./tutorial/tutorial5/pom.xml /src/tutorial/tutorial5/pom.xml -COPY ./tutorial/tutorial6/pom.xml /src/tutorial/tutorial6/pom.xml - -RUN mvn -f pom.xml dependency:resolve --fail-never + +COPY modules-core/pom.xml /src/modules-core/ +COPY modules-core/prov-model-scala/pom.xml /src/modules-core/prov-model-scala/ +COPY modules-core/prov-model/pom.xml /src/modules-core/prov-model/ +COPY modules-core/prov-jsonld-xml/pom.xml /src/modules-core/prov-jsonld-xml/ + +COPY modules-misc/pom.xml /src/modules-misc/ +COPY modules-misc/prov-dot/pom.xml /src/modules-misc/prov-dot/ +COPY modules-misc/prov-generator/pom.xml /src/modules-misc/prov-generator/ + +COPY modules-legacy/pom.xml /src/modules-legacy/ +COPY modules-legacy/prov-json/pom.xml /src/modules-legacy/prov-json/ +COPY modules-legacy/prov-xml/pom.xml /src/modules-legacy/prov-xml/ +COPY modules-legacy/roundtrip/pom.xml /src/modules-legacy/roundtrip/ +COPY modules-legacy/prov-n/pom.xml /src/modules-legacy/prov-n/ +COPY modules-legacy/prov-sql/pom.xml /src/modules-legacy/prov-sql/ +COPY modules-legacy/prov-rdf/pom.xml /src/modules-legacy/prov-rdf/ + +COPY modules-template/pom.xml /src/modules-template/ +COPY modules-template/prov-template/pom.xml /src/modules-template/prov-template/ +COPY modules-template/prov-template-compiler/pom.xml /src/modules-template/prov-template-compiler/ + +COPY modules-executable/pom.xml /src/modules-executable/ +COPY modules-executable/prov-interop/pom.xml /src/modules-executable/prov-interop/ +COPY modules-executable/toolbox/pom.xml /src/modules-executable/toolbox/ + +COPY modules-tutorial/pom.xml /src/modules-tutorial/pom.xml +COPY modules-tutorial/tutorial1/pom.xml /src/modules-tutorial/tutorial1/pom.xml +COPY modules-tutorial/tutorial2/pom.xml /src/modules-tutorial/tutorial2/pom.xml +COPY modules-tutorial/tutorial3/pom.xml /src/modules-tutorial/tutorial3/pom.xml +COPY modules-tutorial/tutorial4/pom.xml /src/modules-tutorial/tutorial4/pom.xml +COPY modules-tutorial/tutorial5/pom.xml /src/modules-tutorial/tutorial5/pom.xml +COPY modules-tutorial/tutorial6/pom.xml /src/modules-tutorial/tutorial6/pom.xml + +COPY modules-services/pom.xml /src/modules-services/pom.xml +COPY modules-services/prov-service-translation/pom.xml /src/modules-services/prov-service-translation/pom.xml +COPY modules-services/prov-service-core/pom.xml /src/modules-services/prov-service-core/pom.xml +COPY modules-services/service-translator/pom.xml /src/modules-services/service-translator/pom.xml +COPY modules-services/prov-log/pom.xml /src/modules-services/prov-log/pom.xml +COPY modules-services/docker-service-translator/pom.xml /src/modules-services/docker-service-translator/pom.xml + +RUN mvn dependency:go-offline --fail-never COPY . /src -RUN mvn package +RUN sed -i '/docker-service-translator/d' modules-services/pom.xml +RUN mvn -f pom.xml package diff --git a/Makefile-docker b/Makefile-docker index 13be0882f..551898dfb 100644 --- a/Makefile-docker +++ b/Makefile-docker @@ -3,7 +3,7 @@ build: extract: docker run --name extract --rm provtoolboxbuild sleep 1000 & - sleep 5 - -docker cp extract:/src/toolbox/target/provconvert-0.7.4-SNAPSHOT-release.zip . + sleep 1 + FILE=$$(docker exec extract sh -c 'ls /src/modules-executable/toolbox/target/provconvert-*-release.zip'|tail -1) ;\ + docker cp extract:$$FILE . docker kill extract - [ -e provconvert-0.7.4-SNAPSHOT-release.zip ]