-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (30 loc) · 1.31 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Start from the Official Lightstramer Server image
FROM lightstreamer
# The Kafka Connector project version
ARG VERSION
ENV KAFKA_CONNECTOR_NAME=lightstreamer-kafka-connector-${VERSION}
ENV KAFKA_CONNECTOR_ZIP=${KAFKA_CONNECTOR_NAME}.zip
ENV DEPLOY_DIR=/lightstreamer/adapters/${KAFKA_CONNECTOR_NAME}
# Copy the distribution package
COPY tmp/${KAFKA_CONNECTOR_ZIP} /tmp/${KAFKA_CONNECTOR_ZIP}
# Copy the custom resources
COPY resources /tmp/resources
# Switch to the root user to allow sytem updates.
USER root
RUN set -eux; \
apt-get -y update; \
apt-get install -y unzip rsync; \
# Unzip the distribution package into the Lightstreamer's adapters fodler
unzip /tmp/${KAFKA_CONNECTOR_ZIP} -d /lightstreamer/adapters; \
# Set the env prefix for referencing environment variables in adapters.xml
sed -i -e 's/env_prefix=""/env_prefix="env."/' /lightstreamer/conf/lightstreamer_conf.xml; \
# Copy the custom resources into the Lightstreamer's adapters fodler
rsync -av --exclude=README.md /tmp/resources/* ${DEPLOY_DIR}; \
# Fix ownership
chown lightstreamer:lightstreamer -R ${DEPLOY_DIR}; \
# Clean up
rm -fr /tmp/${KAFKA_CONNECTOR_ZIP} /tmp/resources; \
apt-get remove -y unzip rsync; \
rm -rf /var/lib/apt/lists/*
# Restore the original Lightstreamer user
USER lightstreamer