Removed supervisord from single application images

This commit is contained in:
root
2018-02-22 12:07:15 -08:00
parent cfcad63159
commit 6a382c3f34
108 changed files with 1415 additions and 1766 deletions

View File

@ -7,10 +7,10 @@ ARG VCS_REF
ARG APK_FLAGS_COMMON="-q"
ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
ARG DB_TYPE=mysql
ENV TERM=xterm
ENV TERM=xterm \
ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx
LABEL org.label-schema.name="zabbix-web-nginx-${DB_TYPE}-alpine" \
LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-alpine" \
org.label-schema.vendor="Zabbix LLC" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -53,12 +53,12 @@ RUN addgroup zabbix && \
ARG MAJOR_VERSION=master
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.label-schema.version="${ZBX_VERSION}" \
org.label-schema.vcs-url="${ZBX_SOURCES}" \
org.label-schema.docker.cmd="docker run --name zabbix-web-nginx-${DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-nginx-${DB_TYPE}:alpine-${ZBX_VERSION}"
org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:alpine-${ZBX_VERSION}"
COPY ["conf/tmp/font-config", "/tmp/font-config"]
@ -98,5 +98,3 @@ COPY ["conf/etc/php5/conf.d/99-zabbix.ini", "/etc/php5/conf.d/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["frontend", "mysql", "nginx"]

View File

@ -11,13 +11,13 @@ fi
# Type of Zabbix component
# Possible values: [server, proxy, agent, web, dev]
zbx_type="$1"
zbx_type=${ZBX_TYPE}
# Type of Zabbix database
# Possible values: [mysql, postgresql]
zbx_db_type="$2"
zbx_db_type=${ZBX_DB_TYPE}
# Type of web-server. Valid only with zbx_type = web
# Possible values: [apache, nginx]
zbx_opt_type="$3"
zbx_opt_type=${ZBX_OPT_TYPE}
# Default Zabbix installation name
# Used only by Zabbix web-interface
@ -872,8 +872,8 @@ else
exit 1
fi
if [ -n "$zbx_db_type" ]; then
if [ -n "$zbx_opt_type" ]; then
if [ "$zbx_db_type" != "none" ]; then
if [ "$zbx_opt_type" != "none" ]; then
echo "** Deploying Zabbix $zbx_type ($zbx_opt_type) with $zbx_db_type database"
else
echo "** Deploying Zabbix $zbx_type with $zbx_db_type database"
@ -894,7 +894,7 @@ prepare_system "$zbx_type" "$zbx_opt_type"
[ "$zbx_type" == "frontend" ] && prepare_web $zbx_opt_type $zbx_db_type
[ "${ZBX_ADD_WEB}" == "true" ] && prepare_web ${ZBX_WEB_SERVER} ${ZBX_MAIN_DB}
[ "$zbx_type" == "agentd" ] && prepare_agent
[ "$zbx_type" == "agent" ] && prepare_agent
[ "${ZBX_ADD_AGENT}" == "true" ] && prepare_agent
[ "$zbx_type" == "java-gateway" ] && prepare_java_gateway
@ -904,7 +904,37 @@ clear_deploy "$zbx_type"
echo "########################################################"
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
if [ "$1" != "" ]; then
echo "** Executing '$@'"
exec "$@"
elif [ "$zbx_type" == "agent" ]; then
echo "** Starting Zabbix agent"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_agentd --foreground -c /etc/zabbix/zabbix_agentd.conf"
elif [ "$zbx_type" == "proxy" ]; then
echo "** Starting Zabbix proxy"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_proxy --foreground -c /etc/zabbix/zabbix_proxy.conf"
elif [ "$zbx_type" == "server" ]; then
echo "** Starting Zabbix server"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_server --foreground -c /etc/zabbix/zabbix_server.conf"
elif [ "$zbx_type" == "java-gateway" ]; then
echo "** Starting Zabbix Java Gateway"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_java_gateway"
elif [ "$zbx_type" == "frontend" ] && [ "$zbx_opt_type" == "apache" ]; then
echo "** Starting Zabbix frontend"
if [ -f "/usr/sbin/httpd" ]; then
exec /usr/sbin/httpd -D FOREGROUND
elif [ -f "/usr/sbin/apache2ctl" ]; then
exec source /etc/apache2/envvars && /usr/sbin/apache2ctl -D FOREGROUND
else
echo "Unknown Web-server. Exiting..."
exit 1
fi
elif [ -f "/usr/bin/supervisord" ]; then
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
else
echo "Unknown instructions. Exiting..."
exit 1
fi
#################################################

View File

@ -7,10 +7,10 @@ ARG VCS_REF
ARG YUM_FLAGS_COMMON="--quiet -y"
ARG YUM_FLAGS_PERSISTANT="${YUM_FLAGS_COMMON}"
ARG YUM_FLAGS_DEV="${YUM_FLAGS_COMMON}"
ARG DB_TYPE=mysql
ENV TERM=xterm
ENV TERM=xterm \
ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx
LABEL org.label-schema.name="zabbix-web-nginx-${DB_TYPE}-centos" \
LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-centos" \
org.label-schema.vendor="Zabbix LLC" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -52,12 +52,12 @@ RUN groupadd --system zabbix && \
ARG MAJOR_VERSION=master
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.label-schema.version="${ZBX_VERSION}" \
org.label-schema.vcs-url="${ZBX_SOURCES}" \
org.label-schema.docker.cmd="docker run --name zabbix-web-nginx-${DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-nginx-${DB_TYPE}:centos-${ZBX_VERSION}"
org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:centos-${ZBX_VERSION}"
COPY ["conf/tmp/font-config", "/tmp/font-config"]
@ -102,5 +102,3 @@ COPY ["conf/etc/php.d/99-zabbix.ini", "/etc/php.d/99-zabbix.ini"]
COPY ["docker-entrypoint.sh", "/usr/bin/"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["frontend", "mysql", "nginx"]

View File

@ -11,13 +11,13 @@ fi
# Type of Zabbix component
# Possible values: [server, proxy, agent, web, dev]
zbx_type="$1"
zbx_type=${ZBX_TYPE}
# Type of Zabbix database
# Possible values: [mysql, postgresql]
zbx_db_type="$2"
zbx_db_type=${ZBX_DB_TYPE}
# Type of web-server. Valid only with zbx_type = web
# Possible values: [apache, nginx]
zbx_opt_type="$3"
zbx_opt_type=${ZBX_OPT_TYPE}
# Default Zabbix installation name
# Used only by Zabbix web-interface
@ -872,8 +872,8 @@ else
exit 1
fi
if [ -n "$zbx_db_type" ]; then
if [ -n "$zbx_opt_type" ]; then
if [ "$zbx_db_type" != "none" ]; then
if [ "$zbx_opt_type" != "none" ]; then
echo "** Deploying Zabbix $zbx_type ($zbx_opt_type) with $zbx_db_type database"
else
echo "** Deploying Zabbix $zbx_type with $zbx_db_type database"
@ -894,7 +894,7 @@ prepare_system "$zbx_type" "$zbx_opt_type"
[ "$zbx_type" == "frontend" ] && prepare_web $zbx_opt_type $zbx_db_type
[ "${ZBX_ADD_WEB}" == "true" ] && prepare_web ${ZBX_WEB_SERVER} ${ZBX_MAIN_DB}
[ "$zbx_type" == "agentd" ] && prepare_agent
[ "$zbx_type" == "agent" ] && prepare_agent
[ "${ZBX_ADD_AGENT}" == "true" ] && prepare_agent
[ "$zbx_type" == "java-gateway" ] && prepare_java_gateway
@ -904,7 +904,37 @@ clear_deploy "$zbx_type"
echo "########################################################"
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
if [ "$1" != "" ]; then
echo "** Executing '$@'"
exec "$@"
elif [ "$zbx_type" == "agent" ]; then
echo "** Starting Zabbix agent"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_agentd --foreground -c /etc/zabbix/zabbix_agentd.conf"
elif [ "$zbx_type" == "proxy" ]; then
echo "** Starting Zabbix proxy"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_proxy --foreground -c /etc/zabbix/zabbix_proxy.conf"
elif [ "$zbx_type" == "server" ]; then
echo "** Starting Zabbix server"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_server --foreground -c /etc/zabbix/zabbix_server.conf"
elif [ "$zbx_type" == "java-gateway" ]; then
echo "** Starting Zabbix Java Gateway"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_java_gateway"
elif [ "$zbx_type" == "frontend" ] && [ "$zbx_opt_type" == "apache" ]; then
echo "** Starting Zabbix frontend"
if [ -f "/usr/sbin/httpd" ]; then
exec /usr/sbin/httpd -D FOREGROUND
elif [ -f "/usr/sbin/apache2ctl" ]; then
exec source /etc/apache2/envvars && /usr/sbin/apache2ctl -D FOREGROUND
else
echo "Unknown Web-server. Exiting..."
exit 1
fi
elif [ -f "/usr/bin/supervisord" ]; then
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
else
echo "Unknown instructions. Exiting..."
exit 1
fi
#################################################

View File

@ -7,10 +7,10 @@ ARG VCS_REF
ARG APT_FLAGS_COMMON="-qq -y"
ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
ARG DB_TYPE=mysql
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm \
ZBX_TYPE=frontend ZBX_DB_TYPE=mysql ZBX_OPT_TYPE=nginx
LABEL org.label-schema.name="zabbix-web-nginx-${DB_TYPE}-ubuntu" \
LABEL org.label-schema.name="zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}-ubuntu" \
org.label-schema.vendor="Zabbix LLC" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.description="Zabbix web-interface based on Nginx web server with MySQL database support" \
@ -37,8 +37,8 @@ RUN locale-gen $LC_ALL && \
apt-get ${APT_FLAGS_COMMON} install \
wget 1>/dev/null && \
DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
wget -q http://nginx.org/keys/nginx_signing.key -O- | apt-key add - && \
echo "deb http://nginx.org/packages/ubuntu/ $DISTRIB_CODENAME nginx" >> /etc/apt/sources.list.d/nginx.list && \
wget -q https://nginx.org/keys/nginx_signing.key -O- | apt-key add - && \
echo "deb https://nginx.org/packages/ubuntu/ $DISTRIB_CODENAME nginx" >> /etc/apt/sources.list.d/nginx.list && \
apt-get ${APT_FLAGS_COMMON} update && \
apt-get ${APT_FLAGS_PERSISTANT} install \
mysql-client \
@ -62,12 +62,12 @@ RUN locale-gen $LC_ALL && \
ARG MAJOR_VERSION=master
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
LABEL org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.label-schema.version="${ZBX_VERSION}" \
org.label-schema.vcs-url="${ZBX_SOURCES}" \
org.label-schema.docker.cmd="docker run --name zabbix-web-nginx-${DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-nginx-${DB_TYPE}:ubuntu-${ZBX_VERSION}"
org.label-schema.docker.cmd="docker run --name zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE} --link mysql-server:mysql --link zabbix-server:zabbix-server -p 80:80 -d zabbix-web-${ZBX_OPT_TYPE}-${ZBX_DB_TYPE}:ubuntu-${ZBX_VERSION}"
COPY ["conf/tmp/font-config", "/tmp/font-config"]
@ -119,5 +119,3 @@ COPY ["conf/etc/php5/fpm/conf.d/99-zabbix.ini", "/etc/php5/fpm/conf.d/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["frontend", "mysql", "nginx"]

View File

@ -11,13 +11,13 @@ fi
# Type of Zabbix component
# Possible values: [server, proxy, agent, web, dev]
zbx_type="$1"
zbx_type=${ZBX_TYPE}
# Type of Zabbix database
# Possible values: [mysql, postgresql]
zbx_db_type="$2"
zbx_db_type=${ZBX_DB_TYPE}
# Type of web-server. Valid only with zbx_type = web
# Possible values: [apache, nginx]
zbx_opt_type="$3"
zbx_opt_type=${ZBX_OPT_TYPE}
# Default Zabbix installation name
# Used only by Zabbix web-interface
@ -872,8 +872,8 @@ else
exit 1
fi
if [ -n "$zbx_db_type" ]; then
if [ -n "$zbx_opt_type" ]; then
if [ "$zbx_db_type" != "none" ]; then
if [ "$zbx_opt_type" != "none" ]; then
echo "** Deploying Zabbix $zbx_type ($zbx_opt_type) with $zbx_db_type database"
else
echo "** Deploying Zabbix $zbx_type with $zbx_db_type database"
@ -894,7 +894,7 @@ prepare_system "$zbx_type" "$zbx_opt_type"
[ "$zbx_type" == "frontend" ] && prepare_web $zbx_opt_type $zbx_db_type
[ "${ZBX_ADD_WEB}" == "true" ] && prepare_web ${ZBX_WEB_SERVER} ${ZBX_MAIN_DB}
[ "$zbx_type" == "agentd" ] && prepare_agent
[ "$zbx_type" == "agent" ] && prepare_agent
[ "${ZBX_ADD_AGENT}" == "true" ] && prepare_agent
[ "$zbx_type" == "java-gateway" ] && prepare_java_gateway
@ -904,7 +904,37 @@ clear_deploy "$zbx_type"
echo "########################################################"
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
if [ "$1" != "" ]; then
echo "** Executing '$@'"
exec "$@"
elif [ "$zbx_type" == "agent" ]; then
echo "** Starting Zabbix agent"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_agentd --foreground -c /etc/zabbix/zabbix_agentd.conf"
elif [ "$zbx_type" == "proxy" ]; then
echo "** Starting Zabbix proxy"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_proxy --foreground -c /etc/zabbix/zabbix_proxy.conf"
elif [ "$zbx_type" == "server" ]; then
echo "** Starting Zabbix server"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_server --foreground -c /etc/zabbix/zabbix_server.conf"
elif [ "$zbx_type" == "java-gateway" ]; then
echo "** Starting Zabbix Java Gateway"
exec su zabbix -s "/bin/bash" -c "/usr/sbin/zabbix_java_gateway"
elif [ "$zbx_type" == "frontend" ] && [ "$zbx_opt_type" == "apache" ]; then
echo "** Starting Zabbix frontend"
if [ -f "/usr/sbin/httpd" ]; then
exec /usr/sbin/httpd -D FOREGROUND
elif [ -f "/usr/sbin/apache2ctl" ]; then
exec source /etc/apache2/envvars && /usr/sbin/apache2ctl -D FOREGROUND
else
echo "Unknown Web-server. Exiting..."
exit 1
fi
elif [ -f "/usr/bin/supervisord" ]; then
echo "** Executing supervisord"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
else
echo "Unknown instructions. Exiting..."
exit 1
fi
#################################################