Repository: marmotta
Updated Branches:
  refs/heads/MARMOTTA-588 [created] b18758d12


MARMOTTA-588: initial version of a docker file for marmotta


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/b18758d1
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/b18758d1
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/b18758d1

Branch: refs/heads/MARMOTTA-588
Commit: b18758d120f681a7a4f888002ef9259c2e2e3386
Parents: 58258b8
Author: Sergio Fernández <[email protected]>
Authored: Fri Apr 3 16:32:24 2015 +0200
Committer: Sergio Fernández <[email protected]>
Committed: Fri Apr 3 16:32:24 2015 +0200

----------------------------------------------------------------------
 launchers/marmotta-docker/Dockerfile | 51 +++++++++++++++++++++++++++++++
 launchers/marmotta-docker/README.md  | 16 ++++++++++
 2 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b18758d1/launchers/marmotta-docker/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-docker/Dockerfile 
b/launchers/marmotta-docker/Dockerfile
new file mode 100644
index 0000000..08f5d91
--- /dev/null
+++ b/launchers/marmotta-docker/Dockerfile
@@ -0,0 +1,51 @@
+# Dockerfile for Apache Marmotta
+
+FROM debian:jessie
+
+MAINTAINER Sergio Fernández <[email protected]>
+
+# general configuration
+ENV DEBIAN_FRONTEND noninteractive
+ENV baseurl http://localhost:8080/marmotta
+ENV dbname marmotta
+ENV dbuser marmotta
+ENV dbpass s3cr3t
+WORKDIR /code
+
+# make sure the package repository is up to date
+RUN apt-get update
+
+# install some required tools
+RUN apt-get install -y git maven openjdk-7-jdk postgresql curl gdebi
+RUN apt-get clean
+
+# get the source code
+RUN git clone -b develop https://git-wip-us.apache.org/repos/asf/marmotta.git
+RUN cd marmotta && git pull
+
+# package from source code
+# RUN cd marmotta && mvn install -DskipTests -DskipITs -Djdeb.signing=false
+RUN cd marmotta/launchers/marmotta-webapp && mvn package -Djdeb.signing=false
+
+# install webapp
+RUN gdebi marmotta/launchers/marmotta-webapp/target/marmotta*.deb
+
+# setup database
+RUN sudo -u postgres psql -c "CREATE USER $dbuser WITH PASSWORD '$dbpass'"
+RUN sudo -u postgres psql -c "CREATE DATABASE $dbname WITH OWNER $dbuser"
+
+# wait until it actually boots
+until [ "`curl --silent --show-error --connect-timeout 1 -I $baseurl/ | grep 
'Coyote'`" != "" ]; do echo "marmotta not yet ready, sleeping for 10 
seconds..." && sleep 10 done
+
+# for development purposes disable security
+RUN curl -X POST -H "Content-Type: application/json" -d '["false"]' 
$baseurl/config/data/security.enabled
+
+# configure postgres as database
+RUN curl -X POST -H "Content-Type: application/json" -d '["postgres"]' 
$baseurl/config/data/database.type
+RUN curl -X POST -H "Content-Type: application/json" -d 
'["jdbc:postgresql://localhost:5432/$dbname?prepareThreshold=3"]' 
$baseurl/config/data/database.url
+RUN curl -X POST -H "Content-Type: application/json" -d '["$dbuser"]' 
$baseurl/config/data/database.user
+RUN curl -X POST -H "Content-Type: application/json" -d '["$dbpass"]' 
$baseurl/config/data/database.password
+RUN curl -X POST $baseurl/system/database/reinit
+
+EXPOSE 8080
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b18758d1/launchers/marmotta-docker/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-docker/README.md 
b/launchers/marmotta-docker/README.md
new file mode 100644
index 0000000..cc34468
--- /dev/null
+++ b/launchers/marmotta-docker/README.md
@@ -0,0 +1,16 @@
+# Apache Marmotta Docker launcher
+
+This launcher creates a Docker images that you can user for developing or 
testing
+Apache Marmotta.
+
+## Build image
+
+    sudo docker build .
+
+## Get image
+
+@@TODO@@: push it to asf or docker hub
+
+## Run it
+
+    docker run -p 8080:8080

Reply via email to