forked from supermy/mytools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
102 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
FROM probablyfine/flume:latest | ||
FROM supermy/docker-jre:7 | ||
|
||
#FROM probablyfine/flume:latest | ||
|
||
RUN mkdir /opt/flume | ||
RUN wget -qO- http://archive.apache.org/dist/flume/1.5.0/apache-flume-1.5.0-bin.tar.gz \ | ||
| tar zxvf - -C /opt/flume --strip 1 | ||
|
||
|
||
COPY conf /var/tmp/ | ||
COPY lib /opt/flume/lib/ | ||
|
||
#RUN apt-get install netcat telnet -q -y | ||
|
||
RUN ls -hl /opt/flume/lib | ||
|
||
RUN ls -hl /var/tmp/ | ||
#RUN ls -hl /opt/flume/lib | ||
#RUN ls -hl /var/tmp/ | ||
|
||
|
||
RUN cat /etc/hosts | ||
|
||
RUN echo "192.168.59.103 hbasemasteripc" >> /etc/hosts | ||
|
||
|
||
ADD start-flume.sh /opt/flume/bin/start-flume | ||
|
||
ENV JAVA_HOME /opt/java | ||
ENV PATH /opt/flume/bin:/opt/java/bin:$PATH | ||
|
||
CMD [ "start-flume" ] | ||
|
||
EXPOSE 44444 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
FLUME_CONF_DIR=${FLUME_CONF_DIR:-/opt/flume/conf} | ||
|
||
[[ -z "${FLUME_CONF_FILE}" ]] && { echo "FLUME_CONF_FILE required"; exit 1; } | ||
[[ -z "${FLUME_AGENT_NAME}" ]] && { echo "FLUME_AGENT_NAME required"; exit 1; } | ||
|
||
echo "Starting flume agent : ${FLUME_AGENT_NAME}" | ||
|
||
flume-ng agent \ | ||
-c ${FLUME_CONF_DIR} \ | ||
-f ${FLUME_CONF_FILE} \ | ||
-n ${FLUME_AGENT_NAME} \ | ||
-Dflume.root.logger=INFO,console | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
if [ -f /.tomcat_admin_created ]; then | ||
echo "Tomcat 'admin' user already created" | ||
exit 0 | ||
fi | ||
|
||
#generate password | ||
PASS=${TOMCAT_PASS:-$(pwgen -s 12 1)} | ||
_word=$( [ ${TOMCAT_PASS} ] && echo "preset" || echo "random" ) | ||
|
||
echo "=> Creating and admin user with a ${_word} password in Tomcat" | ||
sed -i -r 's/<\/tomcat-users>//' ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo '<role rolename="manager-gui"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo '<role rolename="manager-script"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo '<role rolename="manager-jmx"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo '<role rolename="admin-gui"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo '<role rolename="admin-script"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo "<user username=\"admin\" password=\"${PASS}\" roles=\"manager-gui,manager-script,manager-jmx,admin-gui, admin-script\"/>" >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo '</tomcat-users>' >> ${CATALINA_HOME}/conf/tomcat-users.xml | ||
echo "=> Done!" | ||
touch /.tomcat_admin_created | ||
|
||
echo "========================================================================" | ||
echo "You can now configure to this Tomcat server using:" | ||
echo "" | ||
echo " admin:${PASS}" | ||
echo "" | ||
echo "========================================================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -f /.tomcat_admin_created ]; then | ||
/create_tomcat_admin_user.sh | ||
fi | ||
|
||
exec ${CATALINA_HOME}/bin/catalina.sh run |