From 01f39cb8be124226f6b6b0dc1c52bd9ed7106b0d Mon Sep 17 00:00:00 2001 From: Oguzhan Unlu Date: Wed, 5 Sep 2018 12:28:00 +0300 Subject: [PATCH] Add Iglu Server to 0.4.0 image (closes #74) --- .travis.yml | 2 +- iglu-server/0.4.0/Dockerfile | 30 ++++++++++++++++++++++++++ iglu-server/0.4.0/docker-entrypoint.sh | 12 +++++++++++ iglu-server/README.md | 3 ++- iglu-server/example/docker-compose.yml | 2 +- 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 iglu-server/0.4.0/Dockerfile create mode 100755 iglu-server/0.4.0/docker-entrypoint.sh diff --git a/.travis.yml b/.travis.yml index 26cb5b3..e1cecbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ env: - IMG=stream-enrich/0.19.0/nsq - IMG=s3-loader/0.6.0 - IMG=elasticsearch-loader/0.10.2 - - IMG=iglu-server/0.3.0 + - IMG=iglu-server/0.4.0 - IMG=piinguin-server/0.1.1 global: # BINTRAY_SNOWPLOW_DOCKER_USER diff --git a/iglu-server/0.4.0/Dockerfile b/iglu-server/0.4.0/Dockerfile new file mode 100644 index 0000000..f30ec42 --- /dev/null +++ b/iglu-server/0.4.0/Dockerfile @@ -0,0 +1,30 @@ +FROM snowplow-docker-registry.bintray.io/snowplow/base-debian:0.1.0 +LABEL maintainer="Snowplow Analytics Ltd. " + +# The version of the server to download +ENV IGLU_SERVER_VERSION="0.4.0" + +# The name of the archive to download +ENV ARCHIVE="iglu_server_${IGLU_SERVER_VERSION}.zip" + +# Install Iglu Server, postgresql client +RUN mkdir -p /tmp/build && \ + cd /tmp/build && \ + wget -q http://dl.bintray.com/snowplow/snowplow-generic/${ARCHIVE} && \ + unzip -d ${SNOWPLOW_BIN_PATH} ${ARCHIVE} && \ + cd /tmp && \ + rm -rf /tmp/build && \ + chown -R snowplow:snowplow ${SNOWPLOW_BIN_PATH} && \ + apt-get update && \ + # Workaround https://lists.debian.org/debian-user/2017/08/msg01557.html + mkdir -p /usr/share/man/man7 && \ + apt-get install -y postgresql-client-9.6 + +EXPOSE 8080 + +# Defines an entrypoint script delegating the launching of the server to the snowplow user. +# The script uses dumb-init as the top-level process. +COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +ENTRYPOINT [ "docker-entrypoint.sh" ] + +CMD [ "--help" ] diff --git a/iglu-server/0.4.0/docker-entrypoint.sh b/iglu-server/0.4.0/docker-entrypoint.sh new file mode 100755 index 0000000..128d009 --- /dev/null +++ b/iglu-server/0.4.0/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/usr/bin/dumb-init /bin/sh +set -e + +# If the config directory has been mounted through -v, we chown it. +if [ "$(stat -c %u ${SNOWPLOW_CONFIG_PATH})" != "$(id -u snowplow)" ]; then + chown -R snowplow:snowplow ${SNOWPLOW_CONFIG_PATH} +fi + +# Make sure we run the server as the snowplow user +exec gosu snowplow:snowplow /usr/bin/java \ + $SP_JAVA_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap \ + -jar ${SNOWPLOW_BIN_PATH}/iglu-server-${IGLU_SERVER_VERSION}.jar "$@" diff --git a/iglu-server/README.md b/iglu-server/README.md index 12d21ef..ef9d8df 100644 --- a/iglu-server/README.md +++ b/iglu-server/README.md @@ -4,6 +4,7 @@ This folder contains * docker images of [Iglu Server](iglu-server) * `0.3.0` + * `0.4.0` * a docker compose example to run [Iglu Server](iglu-server) with [Postgres](https://github.com/docker-library/postgres) ## Introduction @@ -36,7 +37,7 @@ Additional JVM options can be set through the `SP_JAVA_OPTS` environment variabl 3) Build image ``` - $ VERSION=0.3.0 + $ VERSION=0.4.0 $ docker build -t iglu-server:${VERSION} $VERSION ``` diff --git a/iglu-server/example/docker-compose.yml b/iglu-server/example/docker-compose.yml index 7fa3672..372f20c 100644 --- a/iglu-server/example/docker-compose.yml +++ b/iglu-server/example/docker-compose.yml @@ -13,7 +13,7 @@ services: max-size: 1G iglu-server: container_name: iglu-server - image: snowplow-docker-registry.bintray.io/snowplow/iglu-server:0.3.0 + image: snowplow-docker-registry.bintray.io/snowplow/iglu-server:0.4.0 entrypoint: /usr/local/bin/wait-for-postgres.sh postgres --config /snowplow/config/application.conf depends_on: - postgres