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 2015/11/12 18:08:01 UTC

[1/2] marmotta git commit: MARMOTTA-588: switched to an entrypoint to have more control about the container lifecycle

Repository: marmotta
Updated Branches:
  refs/heads/MARMOTTA-588 940cac1f9 -> 59a2b9eaf


MARMOTTA-588: switched to an entrypoint to have more control about the container lifecycle


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

Branch: refs/heads/MARMOTTA-588
Commit: f47d21421ec007bc2f7ca0df772c3b306e6fdecf
Parents: 940cac1
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 18:07:12 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 18:07:12 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-webapp/Dockerfile            |  4 +---
 .../marmotta-webapp/src/docker/entrypoint.sh    | 23 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/f47d2142/launchers/marmotta-webapp/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/Dockerfile b/launchers/marmotta-webapp/Dockerfile
index 26713a8..f89585c 100644
--- a/launchers/marmotta-webapp/Dockerfile
+++ b/launchers/marmotta-webapp/Dockerfile
@@ -68,7 +68,5 @@ RUN chown -R tomcat7:tomcat7 "$(dirname $CONF_PATH)"
 #RUN mvn clean
 RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
 
-CMD service postgresql start; \
-    service tomcat7 start; \
-	tail -f /var/log/tomcat7/catalina.out
+ENTRYPOINT ["/marmotta-webapp/src/docker/entrypoint.sh"]
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f47d2142/launchers/marmotta-webapp/src/docker/entrypoint.sh
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/docker/entrypoint.sh b/launchers/marmotta-webapp/src/docker/entrypoint.sh
new file mode 100755
index 0000000..2769a28
--- /dev/null
+++ b/launchers/marmotta-webapp/src/docker/entrypoint.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+# SIGTERM-handler
+sigterm_handler() {
+  service tomcat7 stop
+  service postgresql stop
+  exit 143; # 128 + 15 -- SIGTERM
+}
+
+# setup handlers on callback
+# kill the last background process (tail) and execute the custom handler
+trap 'kill ${!}; sigterm_handler' SIGTERM
+
+# run application
+service postgresql start
+service tomcat7 start
+
+# wait indefinetely
+while true
+do
+  tail -f /var/log/tomcat7/catalina.out & wait ${!}
+done
+


[2/2] marmotta git commit: MARMOTTA-588: extended doc

Posted by wi...@apache.org.
MARMOTTA-588: extended doc


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

Branch: refs/heads/MARMOTTA-588
Commit: 59a2b9eaf53537cf63410c8b7a11a88edadb1181
Parents: f47d214
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 18:07:42 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 18:07:42 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/marmotta/blob/59a2b9ea/launchers/marmotta-webapp/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/README.md b/launchers/marmotta-webapp/README.md
index 8e361a6..88f38ae 100644
--- a/launchers/marmotta-webapp/README.md
+++ b/launchers/marmotta-webapp/README.md
@@ -2,6 +2,8 @@
 
 This folder contains a JavaEE Web Application for launching Marmotta in any Servlet (>=3.0) container.
 
+Further details at the `src/main/doc/README.txt` file.
+
 ## WAR
 
 For building the WAR just execute:
@@ -26,10 +28,20 @@ It also comes with support for creating a Docker images that you can user for de
 * 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).
-* Get details about the container: `docker ps --filter "ancestor=marmotta` and `docker inspect CONTAINER_ID`.
-* Get basic statistics about the container: `docker stats [CONTAINERID] `
+
+If you want to further work with the container, here some basic instructions:
+
+* List running containers: `docker ps` (appending `--filter "ancestor=marmotta` shows only the `marmotta` images, `-a` lists all)
+* Get details about the container: `docker inspect CONTAINER_ID`
+* Get basic statistics about the container: `docker stats [CONTAINERID]`
 * Commit the container changes to a new image: `docker commit [CONTAINERID] my-marmotta`
 * Stop the container: `docker stop [CONTAINERID]`
+* Start again the container: `docker start [CONTAINERID]`
+* Remove a container: `docker rm CONTAINER_ID`
+* Remove all containers `docker rm $(docker ps -a -q)`
+* List all images: `docker images`
+* Remove an image: `docker rmi IMAGE_ID`
+* Remove all images: `docker rmi $(docker images -q)`
 
 For further instructions, please take a look to the [Docker User Guide](https://docs.docker.com/userguide/).