From 707c2a0e91d83d34802f6d31f4ceeb3712bc189f Mon Sep 17 00:00:00 2001 From: Artur Stawiarski Date: Fri, 29 Jan 2016 16:41:34 +0000 Subject: [PATCH 1/2] Added support for enabling HiPE compiler through HIPE_COMPILE environment variable --- Dockerfile | 1 + docker-entrypoint.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e1a4322..903469a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,7 @@ RUN echo 'deb http://packages.erlang-solutions.com/debian jessie contrib' > /etc RUN apt-get update \ && apt-get install -y --no-install-recommends \ erlang-asn1 \ + erlang-base-hipe \ erlang-crypto \ erlang-eldap \ erlang-inets \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 151ea6df..42b45e0e 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -42,6 +42,7 @@ if [ "$1" = 'rabbitmq-server' ]; then ssl_ca_file ssl_cert_file ssl_key_file + hipe_compile ) haveConfig= @@ -84,9 +85,15 @@ if [ "$1" = 'rabbitmq-server' ]; then var="RABBITMQ_${conf^^}" val="${!var}" [ "$val" ] || continue - cat >> /etc/rabbitmq/rabbitmq.config <<-EOC - {$conf, <<"$val">>}, - EOC + if [[ $conf == default_pass || $conf == default_user || $conf == default_vhost ]]; then + cat >> /etc/rabbitmq/rabbitmq.config <<-EOC + {$conf, <<"$val">>}, + EOC + else + cat >> /etc/rabbitmq/rabbitmq.config <<-EOC + {$conf, $val}, + EOC + fi done cat >> /etc/rabbitmq/rabbitmq.config <<-'EOF' From 121694b7074d3184c1a8d5bc95f27abe992fdd78 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 5 Jul 2016 16:51:56 -0700 Subject: [PATCH 2/2] Simplify env-to-config conversion code --- docker-entrypoint.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 42b45e0e..c5749a75 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -81,19 +81,30 @@ if [ "$1" = 'rabbitmq-server' ]; then fi for conf in "${configs[@]}"; do - [ "${conf#ssl_}" = "$conf" ] || continue var="RABBITMQ_${conf^^}" val="${!var}" - [ "$val" ] || continue - if [[ $conf == default_pass || $conf == default_user || $conf == default_vhost ]]; then - cat >> /etc/rabbitmq/rabbitmq.config <<-EOC - {$conf, <<"$val">>}, - EOC - else - cat >> /etc/rabbitmq/rabbitmq.config <<-EOC - {$conf, $val}, - EOC - fi + + rawVal= + case "$conf" in + # SSL-related options are configured above, so should be ignored here + ssl_*) continue ;; + + # convert shell booleans into Erlang booleans + hipe_compile) + [ "$val" ] && rawVal='true' || rawVal='false' + ;; + + # otherwise, assume string-based (and skip or add appropriate decorations) + *) + [ "$val" ] || continue + rawVal='<<"'"$val"'">>' + ;; + esac + [ "$rawVal" ] || continue + + cat >> /etc/rabbitmq/rabbitmq.config <<-EOC + {$conf, $rawVal}, + EOC done cat >> /etc/rabbitmq/rabbitmq.config <<-'EOF'