2017-10-18 10:33:27 -04:00
|
|
|
# This is intended to be a temporary unblocker for Travis CI
|
|
|
|
# We should revert this when ppa:webupd8team/java repo maintainers fix the issue shown here: https://github.com/druid-io/druid/pull/4970
|
|
|
|
# Or if we stick to using a non-base Ubuntu image, the custom image should reside in an org repo and not an individual repo
|
|
|
|
# https://hub.docker.com/r/jonweiimply/ubuntu-j8/
|
|
|
|
FROM jonweiimply/ubuntu-j8
|
2014-11-06 13:23:24 -05:00
|
|
|
|
|
|
|
# MySQL (Metadata store)
|
|
|
|
RUN apt-get install -y mysql-server
|
|
|
|
|
|
|
|
# Supervisor
|
|
|
|
RUN apt-get install -y supervisor
|
|
|
|
|
|
|
|
# Zookeeper
|
2016-01-18 00:31:29 -05:00
|
|
|
RUN wget -q -O - http://www.us.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz | tar -xzf - -C /usr/local \
|
|
|
|
&& cp /usr/local/zookeeper-3.4.6/conf/zoo_sample.cfg /usr/local/zookeeper-3.4.6/conf/zoo.cfg \
|
|
|
|
&& ln -s /usr/local/zookeeper-3.4.6 /usr/local/zookeeper
|
2014-11-06 13:23:24 -05:00
|
|
|
|
2015-10-22 17:39:30 -04:00
|
|
|
# Kafka
|
2017-05-28 11:48:39 -04:00
|
|
|
# Match the version to the Kafka client used by KafkaSupervisor
|
|
|
|
RUN wget -q -O - http://www.us.apache.org/dist/kafka/0.10.2.0/kafka_2.11-0.10.2.0.tgz | tar -xzf - -C /usr/local \
|
|
|
|
&& ln -s /usr/local/kafka_2.11-0.10.2.0 /usr/local/kafka
|
2014-11-06 13:23:24 -05:00
|
|
|
|
|
|
|
# Druid system user
|
2015-11-12 20:28:56 -05:00
|
|
|
RUN adduser --system --group --no-create-home druid \
|
|
|
|
&& mkdir -p /var/lib/druid \
|
|
|
|
&& chown druid:druid /var/lib/druid
|
2014-11-06 13:23:24 -05:00
|
|
|
|
2015-11-12 20:28:56 -05:00
|
|
|
# clean up time
|
|
|
|
RUN apt-get clean \
|
|
|
|
&& rm -rf /tmp/* \
|
|
|
|
/var/tmp/* \
|
|
|
|
/var/lib/apt/lists \
|
|
|
|
/root/.m2
|
2014-11-06 13:23:24 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Setup metadata store
|
2015-11-12 20:28:56 -05:00
|
|
|
RUN /etc/init.d/mysql start \
|
|
|
|
&& echo "GRANT ALL ON druid.* TO 'druid'@'%' IDENTIFIED BY 'diurd'; CREATE database druid DEFAULT CHARACTER SET utf8;" | mysql -u root \
|
|
|
|
&& /etc/init.d/mysql stop
|
|
|
|
|
|
|
|
# Add Druid jars
|
|
|
|
ADD lib/* /usr/local/druid/lib/
|
2014-11-06 13:23:24 -05:00
|
|
|
|
|
|
|
# Add sample data
|
2015-11-12 20:28:56 -05:00
|
|
|
RUN /etc/init.d/mysql start \
|
|
|
|
&& java -cp "/usr/local/druid/lib/*" -Ddruid.metadata.storage.type=mysql io.druid.cli.Main tools metadata-init --connectURI="jdbc:mysql://localhost:3306/druid" --user=druid --password=diurd \
|
|
|
|
&& /etc/init.d/mysql stop
|
2014-11-06 13:23:24 -05:00
|
|
|
ADD sample-data.sql sample-data.sql
|
2015-11-12 20:28:56 -05:00
|
|
|
RUN /etc/init.d/mysql start \
|
|
|
|
&& cat sample-data.sql | mysql -u root druid \
|
|
|
|
&& /etc/init.d/mysql stop
|
2014-11-06 13:23:24 -05:00
|
|
|
|
|
|
|
# Setup supervisord
|
|
|
|
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
|
2015-11-12 20:28:56 -05:00
|
|
|
# unless advertised.host.name is set to docker host ip, publishing data fails
|
|
|
|
# run this last to avoid rebuilding the image every time the ip changes
|
|
|
|
ADD docker_ip docker_ip
|
2017-05-28 11:48:39 -04:00
|
|
|
RUN perl -pi -e "s/#advertised.listeners=.*/advertised.listeners=PLAINTEXT:\/\/$(cat docker_ip):9092/" /usr/local/kafka/config/server.properties
|
2014-11-06 13:23:24 -05:00
|
|
|
|
|
|
|
# Expose ports:
|
|
|
|
# - 8081: HTTP (coordinator)
|
|
|
|
# - 8082: HTTP (broker)
|
|
|
|
# - 8083: HTTP (historical)
|
2015-02-18 19:46:06 -05:00
|
|
|
# - 8090: HTTP (overlord)
|
|
|
|
# - 8091: HTTP (middlemanager)
|
2014-11-06 13:23:24 -05:00
|
|
|
# - 3306: MySQL
|
|
|
|
# - 2181 2888 3888: ZooKeeper
|
|
|
|
# - 8100 8101 8102 8103 8104 : peon ports
|
|
|
|
EXPOSE 8081
|
|
|
|
EXPOSE 8082
|
|
|
|
EXPOSE 8083
|
2015-02-18 19:46:06 -05:00
|
|
|
EXPOSE 8090
|
|
|
|
EXPOSE 8091
|
2014-11-06 13:23:24 -05:00
|
|
|
EXPOSE 3306
|
|
|
|
EXPOSE 2181 2888 3888
|
|
|
|
EXPOSE 8100 8101 8102 8103 8104
|
2015-11-12 20:28:56 -05:00
|
|
|
|
2014-11-06 13:23:24 -05:00
|
|
|
WORKDIR /var/lib/druid
|
|
|
|
ENTRYPOINT export HOST_IP="$(resolveip -s $HOSTNAME)" && exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|