Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Scala Stream Collector 0.12.0 image (closes #30)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet committed Jan 2, 2018
1 parent dcbe702 commit 02ee5b2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ script:
env:
matrix:
- IMG=base
- IMG=scala-stream-collector/0.11.0
- IMG=scala-stream-collector/0.12.0
- IMG=stream-enrich/0.12.0
- IMG=s3-loader/0.6.0
- IMG=elasticsearch-loader/0.10.1
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can pull the images from the registry directly:

```bash
# Scala Stream Collector image
docker pull snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector:0.11.0
docker pull snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector:0.12.0

# Stream Enrich image
docker pull snowplow-docker-registry.bintray.io/snowplow/stream-enrich:0.12.0
Expand All @@ -41,7 +41,7 @@ Alternatively, you can build them yourself:
docker pull snowplow-docker-registry.bintray.io/snowplow/base:0.1.0

# Scala Stream Collector image
docker build -t snowplow/scala-stream-collector:0.11.0 scala-stream-collector/0.11.0
docker build -t snowplow/scala-stream-collector:0.12.0 scala-stream-collector/0.12.0

# Stream Enrich image
docker build -t snowplow/stream-enrich:0.12.0 stream-enrich/0.12.0
Expand Down Expand Up @@ -69,8 +69,8 @@ Next, you can run a container for each component by mounting your configuration
# Scala Stream Collector container
docker run \
-v $PWD/scala-stream-collector-config:/snowplow/config \
snowplow/scala-stream-collector:0.11.0 \ # if you have built the image
# snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector:0.11.0 if you have pulled the image
snowplow/scala-stream-collector:0.12.0 \ # if you have built the image
# snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector:0.12.0 if you have pulled the image
--config /snowplow/config/config.hocon

# Stream Enrich
Expand Down
26 changes: 26 additions & 0 deletions scala-stream-collector/0.12.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM snowplow-docker-registry.bintray.io/snowplow/base:0.1.0
LABEL maintainer="Snowplow Analytics Ltd. <[email protected]>"

# The version of the collector to download.
ENV COLLECTOR_VERSION="0.12.0"

# The name of the archive to download.
ENV ARCHIVE="snowplow_scala_stream_collector_${COLLECTOR_VERSION}.zip"

# Install the Scala Stream Collector.
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

# Port used by the collector.
EXPOSE 80

# Defines an entrypoint script delegating the lauching of the collector 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" ]
12 changes: 12 additions & 0 deletions scala-stream-collector/0.12.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 snowplow:snowplow ${SNOWPLOW_CONFIG_PATH}
fi

# Make sure we run the collector as the snowplow user
exec su-exec snowplow:snowplow /usr/bin/java \
$SP_JAVA_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap \
-jar ${SNOWPLOW_BIN_PATH}/snowplow-stream-collector-${COLLECTOR_VERSION}.jar "$@"

0 comments on commit 02ee5b2

Please sign in to comment.