You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2016/04/29 15:51:57 UTC

[1/2] marmotta git commit: MARMOTTA-636: fixed Dockerfile

Repository: marmotta
Updated Branches:
  refs/heads/develop bfe584725 -> 0bcd02970


MARMOTTA-636: fixed Dockerfile


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

Branch: refs/heads/develop
Commit: 1eb1bceb387af2c8ad0049979f217666a3600c95
Parents: bfe5847
Author: Sergio Fernández <wi...@apache.org>
Authored: Fri Apr 29 15:51:21 2016 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Fri Apr 29 15:51:21 2016 +0200

----------------------------------------------------------------------
 .dockerignore                        |  2 +
 Dockerfile                           | 81 +++++++++++++++++++++++++++++++
 launchers/marmotta-webapp/Dockerfile | 72 ---------------------------
 3 files changed, 83 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/1eb1bceb/.dockerignore
----------------------------------------------------------------------
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..f649579
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+**/target
+*~

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1eb1bceb/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..33f8d60
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,81 @@
+# Dockerfile for Apache Marmotta
+
+FROM debian:jessie-backports
+MAINTAINER Sergio Fernández <wi...@apache.org>
+
+EXPOSE 8080
+
+WORKDIR /src
+ADD . /src
+
+# configuration
+ENV DEBIAN_FRONTEND noninteractive
+ENV DB_NAME marmotta
+ENV DB_USER marmotta
+ENV DB_PASS s3cr3t
+ENV PG_VERSION 9.4
+ENV WAR_PATH /src/launchers/marmotta-webapp/target/marmotta.war
+ENV CONF_PATH /var/lib/marmotta/system-config.properties
+
+# prepare the environment
+RUN apt-get update \
+    && apt-get upgrade -y \
+    && apt-get install -y \
+		openjdk-8-jdk \
+		maven \
+        tomcat7 \
+    || apt-get install -y -f
+
+# build
+RUN mvn clean install -DskipTests -DskipITs
+RUN test -e $WAR_PATH || exit
+
+# install and configure postgres from the PGDG repo
+RUN apt-get update && apt-get install -y locales apt-utils \
+	&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+ENV LANG en_US.utf8
+RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
+RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > /etc/apt/sources.list.d/pgdg.list
+RUN apt-get update \
+	&& apt-get install -y postgresql-common \
+	&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
+	&& apt-get install -y \
+		postgresql-$PG_VERSION \
+		postgresql-contrib-$PG_VERSION
+RUN pg_createcluster $PG_VERSION main --start
+USER postgres
+RUN service postgresql start \
+    && psql --command "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';" \
+    && psql --command "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER;"
+USER root
+RUN service postgresql stop
+RUN echo "host all  all    127.0.0.1/32  md5" >> /etc/postgresql/$PG_VERSION/main/pg_hba.conf
+RUN echo "listen_addresses='*'" >> /etc/postgresql/$PG_VERSION/main/postgresql.conf
+
+# install the webapp
+#RUN dpkg --debug=2000 --install target/marmotta_*_all.deb <-- we'd need to fix the postinst
+RUN mkdir -p /usr/share/marmotta
+RUN cp $WAR_PATH /usr/share/marmotta/
+RUN chown tomcat7:tomcat7 /usr/share/marmotta/marmotta.war
+RUN cp /src/launchers/marmotta-webapp/src/deb/tomcat/marmotta.xml /var/lib/tomcat7/conf/Catalina/localhost/
+RUN chown tomcat7:tomcat7 /var/lib/tomcat7/conf/Catalina/localhost/marmotta.xml
+RUN mkdir -p "$(dirname $CONF_PATH)"
+RUN echo "security.enabled = false" > $CONF_PATH
+RUN echo "database.type = postgres" >> $CONF_PATH
+RUN echo "database.url = jdbc:postgresql://localhost:5432/$DB_NAME?prepareThreshold=3" >> $CONF_PATH
+RUN echo "database.user = $DB_USER" >> $CONF_PATH
+RUN echo "database.password = $DB_PASS" >> $CONF_PATH
+RUN chown -R tomcat7:tomcat7 "$(dirname $CONF_PATH)"
+
+# cleanup
+RUN mvn clean \
+    && rm -rf ~/.m2 \
+    && apt-get remove maven --purge \
+    && apt-get autoremove \
+    && apt-get clean -y \
+    && apt-get autoclean -y \
+    && apt-get autoremove -y \
+    && rm -rf /var/lib/apt/lists/*
+
+ENTRYPOINT ["/marmotta-webapp/src/docker/entrypoint.sh"]
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1eb1bceb/launchers/marmotta-webapp/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/Dockerfile b/launchers/marmotta-webapp/Dockerfile
deleted file mode 100644
index f89585c..0000000
--- a/launchers/marmotta-webapp/Dockerfile
+++ /dev/null
@@ -1,72 +0,0 @@
-# Dockerfile for Apache Marmotta
-
-FROM debian:jessie
-MAINTAINER Sergio Fernández <wi...@apache.org>
-
-EXPOSE 8080
-
-WORKDIR /marmotta-webapp
-ADD . /marmotta-webapp
-
-# configuration
-ENV DEBIAN_FRONTEND noninteractive
-ENV DB_NAME marmotta
-ENV DB_USER marmotta
-ENV DB_PASS s3cr3t
-ENV PG_VERSION 9.4
-ENV WAR_PATH target/marmotta.war
-ENV CONF_PATH /var/lib/marmotta/system-config.properties
-
-# test build
-RUN test -e $WAR_PATH || exit
-
-# install and configure postgres from the PGDG repo
-RUN apt-get update && apt-get install -y locales apt-utils \
-	&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
-ENV LANG en_US.utf8
-RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
-RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > /etc/apt/sources.list.d/pgdg.list
-RUN apt-get update \
-	&& apt-get install -y postgresql-common \
-	&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
-	&& apt-get install -y \
-		postgresql-$PG_VERSION \
-		postgresql-contrib-$PG_VERSION
-RUN pg_createcluster $PG_VERSION main --start
-USER postgres
-RUN service postgresql start \
-    && psql --command "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';" \
-    && psql --command "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER;"
-USER root
-RUN service postgresql stop
-RUN echo "host all  all    127.0.0.1/32  md5" >> /etc/postgresql/$PG_VERSION/main/pg_hba.conf
-RUN echo "listen_addresses='*'" >> /etc/postgresql/$PG_VERSION/main/postgresql.conf
-
-# base requirements
-RUN apt-get update \
-	&& apt-get install -y \
-		openjdk-7-jre-headless \
-		tomcat7
-RUN service tomcat7 stop
-
-# package from source code and install the webapp
-#RUN dpkg --debug=2000 --install target/marmotta_*_all.deb <-- we'd need to fix the postinst
-RUN mkdir -p /usr/share/marmotta
-RUN cp $WAR_PATH /usr/share/marmotta/
-RUN chown tomcat7:tomcat7 /usr/share/marmotta/marmotta.war
-RUN cp src/deb/tomcat/marmotta.xml /var/lib/tomcat7/conf/Catalina/localhost/
-RUN chown tomcat7:tomcat7 /var/lib/tomcat7/conf/Catalina/localhost/marmotta.xml
-RUN mkdir -p "$(dirname $CONF_PATH)"
-RUN echo "security.enabled = false" > $CONF_PATH
-RUN echo "database.type = postgres" >> $CONF_PATH
-RUN echo "database.url = jdbc:postgresql://localhost:5432/$DB_NAME?prepareThreshold=3" >> $CONF_PATH
-RUN echo "database.user = $DB_USER" >> $CONF_PATH
-RUN echo "database.password = $DB_PASS" >> $CONF_PATH
-RUN chown -R tomcat7:tomcat7 "$(dirname $CONF_PATH)"
-
-# cleanup
-#RUN mvn clean
-RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
-
-ENTRYPOINT ["/marmotta-webapp/src/docker/entrypoint.sh"]
-


[2/2] marmotta git commit: MARMOTTA-636: updated documentation

Posted by wi...@apache.org.
MARMOTTA-636: updated documentation


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

Branch: refs/heads/develop
Commit: 0bcd0297057f6fdd617e26a6fa25ecf7565bfa7b
Parents: 1eb1bce
Author: Sergio Fernández <wi...@apache.org>
Authored: Fri Apr 29 15:51:38 2016 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Fri Apr 29 15:51:38 2016 +0200

----------------------------------------------------------------------
 launchers/marmotta-webapp/README.md | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/0bcd0297/launchers/marmotta-webapp/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/README.md b/launchers/marmotta-webapp/README.md
index 9bf8f86..b3bdd21 100644
--- a/launchers/marmotta-webapp/README.md
+++ b/launchers/marmotta-webapp/README.md
@@ -24,11 +24,13 @@ and you can find the `.deb` file under `target/`.
 
 It also comes with support for creating a Docker images that you can user for developing or testing:
 
-* Build the launcher: `mvn package`
-* Build image: `docker build -t marmotta .`
-* Run the container: `docker run -p 8080:8080 marmotta`
-* Access Marmotta at [localhost:8080/marmotta](http://localhost:8080/marmotta) (IP address may be different, 
-  see point bellow).
+1. Locate at the root of the source repository
+2. Build image: `docker build -t marmotta .`
+3. Run the container: `docker run -p 8080:8080 marmotta`
+4. Access Marmotta at [localhost:8080/marmotta](http://localhost:8080/marmotta) (IP address may be different, see information bellow).
+
+An official images is [available from Docker Hub](https://hub.docker.com/r/apache/marmotta/) as an automated 
+build, so you just need to pull it from there to replace the second step above: `docker pull apache/marmotta`
 
 If you want to further work with the container, here some basic instructions:
 
@@ -46,5 +48,3 @@ If you want to further work with the container, here some basic instructions:
 
 For further instructions, please take a look to the [Docker User Guide](https://docs.docker.com/userguide/).
 
-@@TODO@@: push it to asf or docker hub
-