From ca8bd5c64dd6e22290ed51ff44acd71fc4a20c28 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Tue, 9 May 2017 12:40:19 +0930 Subject: [PATCH 01/17] Created v4.4.0 of alpine-nginx-nodejs. --- CHANGELOG.md | 8 ++++++++ README.md | 2 +- alpine-nginx-nodejs/Dockerfile | 2 +- alpine-nginx-nodejs/NODEJS.md | 1 + alpine-nginx-nodejs/README.md | 3 ++- alpine-nginx-nodejs/VERSIONS.md | 11 ++++++++++- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe7fd3..a023508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ Due to the nature of versioning and the fact this repository houses multiple Doc Each release records it's own specific changes in a VERSIONS.md file. +## 2017.05.09 + +- `alpine-nginx-nodejs`: upgraded to Node.js `v6.4.0`. + +### Releases + +- [Release `v4.4.0` of `alpine-nginx-nodejs`](https://github.com/smebberson/docker-alpine/tree/alpine-nginx-nodejs-v4.4.0/alpine-nginx-nodejs) + ## 2017.05.08 - `alpine-nginx-nodejs`: upgraded to Node.js `v6.3.1`. diff --git a/README.md b/README.md index 63f0adb..4c83bb2 100644 --- a/README.md +++ b/README.md @@ -291,7 +291,7 @@ Latest version is `3.0.0`, or `latest`. This image includes both Nginx and Node.js. It's suitable if you want to have Node.js perform configuration for Nginx. -Latest version is `4.3.1`, or `latest`. +Latest version is `4.4.0`, or `latest`. - [README.md](https://github.com/smebberson/docker-alpine/blob/master/alpine-nginx-nodejs/README.md) - [VERSIONS.md](https://github.com/smebberson/docker-alpine/blob/master/alpine-nginx-nodejs/VERSIONS.md) diff --git a/alpine-nginx-nodejs/Dockerfile b/alpine-nginx-nodejs/Dockerfile index f37e33f..585aefe 100644 --- a/alpine-nginx-nodejs/Dockerfile +++ b/alpine-nginx-nodejs/Dockerfile @@ -1,7 +1,7 @@ FROM smebberson/alpine-nginx:3.0.0 MAINTAINER Scott Mebberson -ENV NODE_VERSION=v6.3.1 NPM_VERSION=3 +ENV NODE_VERSION=v6.4.0 NPM_VERSION=3 RUN echo "http://dl-4.alpinelinux.org/alpine/v3.2/main" >> /etc/apk/repositories && \ apk add --update git curl make gcc g++ python linux-headers libgcc libstdc++ binutils-gold && \ diff --git a/alpine-nginx-nodejs/NODEJS.md b/alpine-nginx-nodejs/NODEJS.md index 80c215c..d5b330d 100644 --- a/alpine-nginx-nodejs/NODEJS.md +++ b/alpine-nginx-nodejs/NODEJS.md @@ -6,6 +6,7 @@ You can [read more about how these images are versioned here](https://github.com ## 6.x branch of Node.js +- Node v6.4.0: [v4.4.0](VERSIONS.md#v440) - Node v6.3.1: [v4.3.1](VERSIONS.md#v431) - Node v6.3.0: [v4.3.0](VERSIONS.md#v430) - Node v6.2.2: [v4.2.2](VERSIONS.md#v422) diff --git a/alpine-nginx-nodejs/README.md b/alpine-nginx-nodejs/README.md index c09d5fb..8721ab3 100644 --- a/alpine-nginx-nodejs/README.md +++ b/alpine-nginx-nodejs/README.md @@ -12,7 +12,8 @@ This image features: ## Versions -- `4.3.1`, `latest` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-nginx-nodejs-v4.3.1/alpine-nginx-nodejs/Dockerfile) +- `4.4.0`, `latest` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-nginx-nodejs-v4.4.0/alpine-nginx-nodejs/Dockerfile) +- `4.3.1` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-nginx-nodejs-v4.3.1/alpine-nginx-nodejs/Dockerfile) - `4.3.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-nginx-nodejs-v4.3.0/alpine-nginx-nodejs/Dockerfile) - `4.2.2` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-nginx-nodejs-v4.2.2/alpine-nginx-nodejs/Dockerfile) - `4.2.1` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-nginx-nodejs-v4.2.1/alpine-nginx-nodejs/Dockerfile) diff --git a/alpine-nginx-nodejs/VERSIONS.md b/alpine-nginx-nodejs/VERSIONS.md index 8d2e0ff..0032dfe 100644 --- a/alpine-nginx-nodejs/VERSIONS.md +++ b/alpine-nginx-nodejs/VERSIONS.md @@ -4,10 +4,19 @@ This file contains all software versions, that correspond to a version of this i ## Latest -Same as v4.3.1. +Same as v4.4.0. Usage: `smebberson/alpine-nginx-nodejs` or `smebberson/alpine-nginx-nodejs:latest`. +## v4.4.0 + +- [smebberson/alpine-nginx: v3.0.0][smebbersonalpinenginx300] +- [nginx][nginx]: v1.8.1 +- [Node.js][nodejs]: v6.4.0 +- [NPM][npm]: 3.10.5 + +Usage: `smebberson/alpine-nginx-nodejs:4.4.0`. + ## v4.3.1 - [smebberson/alpine-nginx: v3.0.0][smebbersonalpinenginx300] From 60f5ab18115c17f91a44eadbbfcc94a4ac95a086 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Wed, 31 May 2017 16:02:41 +0930 Subject: [PATCH 02/17] Created v3.2.0 of alpine-base. --- CHANGELOG.md | 6 ++++++ README.md | 2 +- alpine-base/README.md | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91df9ac..611fb53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ Due to the nature of versioning and the fact this repository houses multiple Doc Each release records it's own specific changes in a VERSIONS.md file. +## 2017.05.31 + +### Releases + +- [Release `v3.2.0` of `alpine-base`](https://github.com/smebberson/docker-alpine/tree/alpine-base-v3.2.0/alpine-base) + ## 2017.05.09 - `alpine-nginx-nodejs`: upgraded to Node.js `v6.4.0`. diff --git a/README.md b/README.md index be5c336..4dc2b91 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ The following describes the images that are available and the inheritance chain. This image is the base for all containers. All other Docker images within this repository inherit from this Container. -Latest version is `3.1.0`, or `latest`. +Latest version is `3.2.0`, or `latest`. - [README.md](https://github.com/smebberson/docker-alpine/blob/master/alpine-base/README.md) - [VERSIONS.md](https://github.com/smebberson/docker-alpine/blob/master/alpine-base/VERSIONS.md) diff --git a/alpine-base/README.md b/alpine-base/README.md index d5032fb..0a627db 100644 --- a/alpine-base/README.md +++ b/alpine-base/README.md @@ -15,7 +15,8 @@ This image features: ## Versions -- `3.1.0`, `latest` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v3.0.1/alpine-base/Dockerfile) +- `3.2.0`, `latest` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v3.2.0/alpine-base/Dockerfile) +- `3.1.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v3.1.0/alpine-base/Dockerfile) - `3.0.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v3.0.0/alpine-base/Dockerfile) - `2.0.0` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v2.0.0/alpine-base/Dockerfile) - `1.2.1` [(Dockerfile)](https://github.com/smebberson/docker-alpine/blob/alpine-base-v1.2.1/alpine-base/Dockerfile) From a312e71dbb175eef4500740eeb3a2ac56c4579e6 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Thu, 8 Jun 2017 20:02:44 +0930 Subject: [PATCH 03/17] Udated alpine-base and consul on alpine-consul. --- alpine-consul/Dockerfile | 7 ++++--- alpine-consul/build | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/alpine-consul/Dockerfile b/alpine-consul/Dockerfile index 5437c2a..af6d029 100644 --- a/alpine-consul/Dockerfile +++ b/alpine-consul/Dockerfile @@ -1,8 +1,9 @@ -FROM smebberson/alpine-base:3.1.0 +FROM smebberson/alpine-base:3.2.0 MAINTAINER Scott Mebberson -ENV CONSUL_VERSION=0.7.1 \ +ENV CONSUL_VERSION=0.8.3 \ CONSUL_DOMAIN=consul \ + CONSUL_DATA_DIR=/data/consul \ CONSUL_CONFIG_DIR=/etc/consul/conf.d/bootstrap \ CONSUL_SERVER_NAME=consul \ CONSUL_DC=dc1 \ @@ -26,4 +27,4 @@ ADD root / VOLUME ["/data/consul"] -EXPOSE 8300 8301 8301/udp 8302 8302/udp 8400 8500 53 53/udp +EXPOSE 8300 8301 8301/udp 8302 8302/udp 8400 8500 8600 8600/udp 53 53/udp diff --git a/alpine-consul/build b/alpine-consul/build index 2ebb78f..be905a7 100755 --- a/alpine-consul/build +++ b/alpine-consul/build @@ -1 +1 @@ -docker build -t smebberson/alpine-consul /vagrant/alpine-consul +docker build -t smebberson/alpine-consul:local /vagrant/alpine-consul From 0fe0c3dbe6a8551cfc82c0f7d69109cb92a52715 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 07:42:26 +0930 Subject: [PATCH 04/17] Added CONSUL_RUNAS, and the new -node-id property (a custom generation method). --- alpine-consul/root/etc/cont-init.d/30-consul | 6 ++++++ alpine-consul/root/etc/services.d/consul/run | 2 +- alpine-consul/root/usr/bin/consul-node-id | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 alpine-consul/root/etc/cont-init.d/30-consul create mode 100755 alpine-consul/root/usr/bin/consul-node-id diff --git a/alpine-consul/root/etc/cont-init.d/30-consul b/alpine-consul/root/etc/cont-init.d/30-consul new file mode 100644 index 0000000..e48a838 --- /dev/null +++ b/alpine-consul/root/etc/cont-init.d/30-consul @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv sh + +# Unless this has already been defined, set it. +if [ -z "$CONSUL_RUNAS" ]; then + printf "consul" > /var/run/s6/container_environment/CONSUL_RUNAS +fi diff --git a/alpine-consul/root/etc/services.d/consul/run b/alpine-consul/root/etc/services.d/consul/run index 893ee75..e3fed62 100755 --- a/alpine-consul/root/etc/services.d/consul/run +++ b/alpine-consul/root/etc/services.d/consul/run @@ -17,4 +17,4 @@ RETRY_JOIN=`consul-join` CONSUL_JOIN_WAN=`consul-join-wan` # Start Consul. -s6-setuidgid consul consul agent -config-dir $CONSUL_CONFIG_DIR -bind $BIND -advertise $BIND -client $CONSUL_CLIENT $RETRY_JOIN -retry-interval $CONSUL_RETRY_INTERVAL -domain $CONSUL_DOMAIN -datacenter $CONSUL_DC $CONSUL_JOIN_WAN +s6-setuidgid $CONSUL_RUNAS consul agent -node-id=$(consul-node-id) -data-dir=$CONSUL_DATA_DIR -config-dir $CONSUL_CONFIG_DIR -bind $BIND -advertise $BIND -client $CONSUL_CLIENT $RETRY_JOIN -retry-interval $CONSUL_RETRY_INTERVAL -domain $CONSUL_DOMAIN -datacenter $CONSUL_DC $CONSUL_JOIN_WAN diff --git a/alpine-consul/root/usr/bin/consul-node-id b/alpine-consul/root/usr/bin/consul-node-id new file mode 100755 index 0000000..b35303c --- /dev/null +++ b/alpine-consul/root/usr/bin/consul-node-id @@ -0,0 +1,17 @@ +#!/usr/bin/with-contenv sh + +# +# This script provides an entry point to customise the `-node-id` arguments +# passed to consul when starting in agent mode. +# + +# Use this rather than a -node-id generated by Consul because they were clashing. +NODE_ID=$(cat /proc/sys/kernel/random/uuid | sed 's/.\{12\}$/'"$(hostname)"'/') + +# Output debug messages if required. +if [ "$CONSUL_DEBUG" = "true" ]; then + (>&2 echo "[consul-node-id] node-id: $NODE_ID...") +fi + +echo $NODE_ID +exit 0 From aec23f3c969e5130dbc2a2bda5fa11b390df8075 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 07:45:06 +0930 Subject: [PATCH 05/17] Added GO_DNSMASQ_RUNAS to resolver/run --- alpine-consul/root/etc/services.d/resolver/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine-consul/root/etc/services.d/resolver/run b/alpine-consul/root/etc/services.d/resolver/run index ce98688..ca993b8 100644 --- a/alpine-consul/root/etc/services.d/resolver/run +++ b/alpine-consul/root/etc/services.d/resolver/run @@ -4,4 +4,4 @@ BIND=`host-ip` # Start go-dnsmasq. -s6-setuidgid go-dnsmasq go-dnsmasq --default-resolver --ndots "1" --fwd-ndots "0" --stubzones=".$CONSUL_DOMAIN/$BIND:8600" --hostsfile=/etc/hosts >> $GO_DNSMASQ_LOG_FILE 2>&1 +s6-setuidgid $GO_DNSMASQ_RUNAS go-dnsmasq --default-resolver --ndots "1" --fwd-ndots "0" --stubzones=".$CONSUL_DOMAIN/$BIND:8600" --hostsfile=/etc/hosts >> $GO_DNSMASQ_LOG_FILE 2>&1 From b34ee95b280f6dd9501ed046903711c8eb5b90cc Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 07:46:04 +0930 Subject: [PATCH 06/17] You can now customise the time between consul-join checks (added debugging capabilities). --- alpine-consul/root/usr/bin/consul-available | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/alpine-consul/root/usr/bin/consul-available b/alpine-consul/root/usr/bin/consul-available index 9928fba..ce8e1d9 100755 --- a/alpine-consul/root/usr/bin/consul-available +++ b/alpine-consul/root/usr/bin/consul-available @@ -6,10 +6,20 @@ # The script will exit 0 once a DNS query has resolved. # +# Allow the sleep timeframe to be customised. Default to 1. +SLEEP=${CONSUL_AVAILABLE_SLEEP:-1} + # Wait until consul-join finds another Consul server. until consul-join > /dev/null 2>&1 do - sleep 1 + + # Output debug messages if required. + if [ "$CONSUL_DEBUG" = "true" ]; then + (>&2 echo "[consul-available] sleep ($SLEEP)...") + fi + + sleep $SLEEP + done # We have another Consul server available. Exit 0! From 9844984452e79e953cc81bb9bbd433291b0930b2 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 07:46:43 +0930 Subject: [PATCH 07/17] Added Consul join process debugging to consul-join and consul-join-wan. --- alpine-consul/root/usr/bin/consul-join | 5 +++++ alpine-consul/root/usr/bin/consul-join-wan | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/alpine-consul/root/usr/bin/consul-join b/alpine-consul/root/usr/bin/consul-join index 48b7c76..c427c75 100755 --- a/alpine-consul/root/usr/bin/consul-join +++ b/alpine-consul/root/usr/bin/consul-join @@ -19,6 +19,11 @@ if test -z "$JOIN"; then exit 1; fi +# Output debug messages if required +if [ "$CONSUL_DEBUG" = "true" ]; then + (>&2 echo "[consul-join] $JOIN") +fi + # We found at least one. Exit 0! echo "$JOIN" exit 0 diff --git a/alpine-consul/root/usr/bin/consul-join-wan b/alpine-consul/root/usr/bin/consul-join-wan index f3ff429..034f17e 100755 --- a/alpine-consul/root/usr/bin/consul-join-wan +++ b/alpine-consul/root/usr/bin/consul-join-wan @@ -17,5 +17,10 @@ if [ "$CONSUL_ADVERTISE_WAN" ]; then EXTRA=$EXTRA" -advertise-wan $CONSUL_ADVERTISE_WAN" fi +# Output debug messages if required +if [ "$CONSUL_DEBUG" = "true" ]; then + (>&2 echo "[consul-join] $JOIN") +fi + echo "$EXTRA" exit 0 From 747aa9145ba595e4b44c4b96a4d5d21d3e7adda8 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:07:12 +0930 Subject: [PATCH 08/17] Refactored the Consul bootstrap logging capability. --- alpine-consul/root/etc/cont-init.d/30-consul | 5 +++++ alpine-consul/root/etc/cont-init.d/40-consul | 3 +++ alpine-consul/root/usr/bin/consul-available | 6 +++--- alpine-consul/root/usr/bin/consul-debug | 10 ++++++++++ alpine-consul/root/usr/bin/consul-join | 6 ++---- alpine-consul/root/usr/bin/consul-join-wan | 5 +---- alpine-consul/root/usr/bin/consul-node-id | 4 +--- 7 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 alpine-consul/root/etc/cont-init.d/40-consul create mode 100755 alpine-consul/root/usr/bin/consul-debug diff --git a/alpine-consul/root/etc/cont-init.d/30-consul b/alpine-consul/root/etc/cont-init.d/30-consul index e48a838..bb6f870 100644 --- a/alpine-consul/root/etc/cont-init.d/30-consul +++ b/alpine-consul/root/etc/cont-init.d/30-consul @@ -1,5 +1,10 @@ #!/usr/bin/with-contenv sh +# Unless this has already been defined, set it. +if [ -z "$CONSUL_BOOTSTRAP_LOG_FILE" ]; then + printf "/var/log/consul-bootstrap/consul-bootstrap.log" > /var/run/s6/container_environment/CONSUL_BOOTSTRAP_LOG_FILE +fi + # Unless this has already been defined, set it. if [ -z "$CONSUL_RUNAS" ]; then printf "consul" > /var/run/s6/container_environment/CONSUL_RUNAS diff --git a/alpine-consul/root/etc/cont-init.d/40-consul b/alpine-consul/root/etc/cont-init.d/40-consul new file mode 100644 index 0000000..f90b50a --- /dev/null +++ b/alpine-consul/root/etc/cont-init.d/40-consul @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv sh + +mkdir -p `dirname $CONSUL_BOOTSTRAP_LOG_FILE` diff --git a/alpine-consul/root/usr/bin/consul-available b/alpine-consul/root/usr/bin/consul-available index ce8e1d9..525c485 100755 --- a/alpine-consul/root/usr/bin/consul-available +++ b/alpine-consul/root/usr/bin/consul-available @@ -14,13 +14,13 @@ until consul-join > /dev/null 2>&1 do # Output debug messages if required. - if [ "$CONSUL_DEBUG" = "true" ]; then - (>&2 echo "[consul-available] sleep ($SLEEP)...") - fi + consul-debug "[consul-available] sleep ($SLEEP)..." sleep $SLEEP done +consul-debug "[consul-available] consul is available" + # We have another Consul server available. Exit 0! exit 0 diff --git a/alpine-consul/root/usr/bin/consul-debug b/alpine-consul/root/usr/bin/consul-debug new file mode 100755 index 0000000..a17edce --- /dev/null +++ b/alpine-consul/root/usr/bin/consul-debug @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv sh + +# +# This script will take anything from stdin and append to a log file. +# + +# Output debug messages if required. +if [ "$CONSUL_BOOTSTRAP_DEBUG" = "true" ]; then + echo "$@" >> $CONSUL_BOOTSTRAP_LOG_FILE +fi diff --git a/alpine-consul/root/usr/bin/consul-join b/alpine-consul/root/usr/bin/consul-join index c427c75..7d6446c 100755 --- a/alpine-consul/root/usr/bin/consul-join +++ b/alpine-consul/root/usr/bin/consul-join @@ -19,10 +19,8 @@ if test -z "$JOIN"; then exit 1; fi -# Output debug messages if required -if [ "$CONSUL_DEBUG" = "true" ]; then - (>&2 echo "[consul-join] $JOIN") -fi +# Output debug messages if required. +consul-debug "[consul-join] $JOIN" # We found at least one. Exit 0! echo "$JOIN" diff --git a/alpine-consul/root/usr/bin/consul-join-wan b/alpine-consul/root/usr/bin/consul-join-wan index 034f17e..1379122 100755 --- a/alpine-consul/root/usr/bin/consul-join-wan +++ b/alpine-consul/root/usr/bin/consul-join-wan @@ -17,10 +17,7 @@ if [ "$CONSUL_ADVERTISE_WAN" ]; then EXTRA=$EXTRA" -advertise-wan $CONSUL_ADVERTISE_WAN" fi -# Output debug messages if required -if [ "$CONSUL_DEBUG" = "true" ]; then - (>&2 echo "[consul-join] $JOIN") -fi +consul-debug "[consul-join] $JOIN" echo "$EXTRA" exit 0 diff --git a/alpine-consul/root/usr/bin/consul-node-id b/alpine-consul/root/usr/bin/consul-node-id index b35303c..e507e8a 100755 --- a/alpine-consul/root/usr/bin/consul-node-id +++ b/alpine-consul/root/usr/bin/consul-node-id @@ -9,9 +9,7 @@ NODE_ID=$(cat /proc/sys/kernel/random/uuid | sed 's/.\{12\}$/'"$(hostname)"'/') # Output debug messages if required. -if [ "$CONSUL_DEBUG" = "true" ]; then - (>&2 echo "[consul-node-id] node-id: $NODE_ID...") -fi +consul-debug "[consul-node-id] node-id: $NODE_ID..." echo $NODE_ID exit 0 From b737ead56a7829749c5678bf28bbf7ecb4eaadc4 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:08:23 +0930 Subject: [PATCH 09/17] Removed the Consul leave call. --- alpine-consul/root/etc/cont-finish.d/00-consul | 4 ---- 1 file changed, 4 deletions(-) delete mode 100755 alpine-consul/root/etc/cont-finish.d/00-consul diff --git a/alpine-consul/root/etc/cont-finish.d/00-consul b/alpine-consul/root/etc/cont-finish.d/00-consul deleted file mode 100755 index 1b71a23..0000000 --- a/alpine-consul/root/etc/cont-finish.d/00-consul +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/with-contenv sh - -# Tell Consul to leave the cluster. -exec s6-setuidgid consul consul leave -rpc-addr="$HOSTNAME:8400"; From 3e1dc2571a10e5618b91fc7c431ac65097e6357f Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:10:38 +0930 Subject: [PATCH 10/17] Upgraded alpine-consul-base to use update alpine-consul, and bumped consul-template to v0.18.5 --- alpine-consul-base/Dockerfile | 5 +++-- alpine-consul-base/build | 2 +- .../root/etc/consul-template/conf.d/_base.conf | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/alpine-consul-base/Dockerfile b/alpine-consul-base/Dockerfile index 976ad22..5be63de 100644 --- a/alpine-consul-base/Dockerfile +++ b/alpine-consul-base/Dockerfile @@ -1,7 +1,8 @@ -FROM smebberson/alpine-consul:3.1.1 +FROM smebberson/alpine-consul:local MAINTAINER Scott Mebberson -ENV CONSUL_TEMPLATE_VERSION=0.16.0 \ +ENV CONSUL_TEMPLATE_VERSION=0.18.5 \ + CONSUL_DATA_DIR=/data/consul \ CONSUL_CONFIG_DIR=/etc/consul/conf.d # Download and install Consul Template diff --git a/alpine-consul-base/build b/alpine-consul-base/build index 6baf5e3..96c1aa7 100755 --- a/alpine-consul-base/build +++ b/alpine-consul-base/build @@ -1 +1 @@ -docker build -t smebberson/alpine-consul-base /vagrant/alpine-consul-base +docker build -t smebberson/alpine-consul-base:local /vagrant/alpine-consul-base diff --git a/alpine-consul-base/root/etc/consul-template/conf.d/_base.conf b/alpine-consul-base/root/etc/consul-template/conf.d/_base.conf index 64dec09..5e6d2f9 100644 --- a/alpine-consul-base/root/etc/consul-template/conf.d/_base.conf +++ b/alpine-consul-base/root/etc/consul-template/conf.d/_base.conf @@ -1 +1,3 @@ -consul = "127.0.0.1:8500" +consul { + address = "127.0.0.1:8500" +} From 7bfe6dabfd8edb52c62c83706315ecb7859aa23a Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:14:12 +0930 Subject: [PATCH 11/17] Added CONSUL_TEMPLATE_RUNAS. --- alpine-consul-base/root/etc/cont-init.d/00-consul-template | 5 +++++ alpine-consul-base/root/etc/services.d/consul-template/run | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/alpine-consul-base/root/etc/cont-init.d/00-consul-template b/alpine-consul-base/root/etc/cont-init.d/00-consul-template index 108af8e..8b4ad8d 100644 --- a/alpine-consul-base/root/etc/cont-init.d/00-consul-template +++ b/alpine-consul-base/root/etc/cont-init.d/00-consul-template @@ -10,3 +10,8 @@ if [ `consul-template-count` -gt 0 ]; then chown -R consul:consul /etc/consul/conf.d /etc/consul/watches fi fi + +# Unless this has already been defined, set it. +if [ -z "$CONSUL_TEMPLATE_RUNAS" ]; then + printf "consul-template" > /var/run/s6/container_environment/CONSUL_TEMPLATE_RUNAS +fi diff --git a/alpine-consul-base/root/etc/services.d/consul-template/run b/alpine-consul-base/root/etc/services.d/consul-template/run index cc0a25d..8bb352b 100644 --- a/alpine-consul-base/root/etc/services.d/consul-template/run +++ b/alpine-consul-base/root/etc/services.d/consul-template/run @@ -3,4 +3,4 @@ # wait 5s for `consul agent` to become available s6-svwait -u -t 5000 /var/run/s6/services/consul -exec s6-setuidgid consul-template consul-template -config /etc/consul-template/conf.d/ +s6-setuidgid $CONSUL_TEMPLATE_RUNAS consul-template -config /etc/consul-template/conf.d/ From aab141cf22d717d1880175cf8edffa980ffe86cc Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:15:40 +0930 Subject: [PATCH 12/17] Updated alpine-consul-nginx to use the new alpine-consul-base. --- alpine-consul-nginx/Dockerfile | 4 ++-- alpine-consul-nginx/build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine-consul-nginx/Dockerfile b/alpine-consul-nginx/Dockerfile index 3822f84..bfab2e0 100644 --- a/alpine-consul-nginx/Dockerfile +++ b/alpine-consul-nginx/Dockerfile @@ -1,4 +1,4 @@ -FROM smebberson/alpine-consul-base:4.1.0 +FROM smebberson/alpine-consul-base:local MAINTAINER Scott Mebberson # Install nginx @@ -12,7 +12,7 @@ RUN echo "http://dl-4.alpinelinux.org/alpine/v3.3/main" >> /etc/apk/repositories addgroup consul-template nginx # Add the files -ADD root / +COPY root / # Setup permissions to allow consul-template to manage nginx RUN mkdir /etc/services.d/nginx/supervise/ && \ diff --git a/alpine-consul-nginx/build b/alpine-consul-nginx/build index 4044a16..8f52a2c 100755 --- a/alpine-consul-nginx/build +++ b/alpine-consul-nginx/build @@ -1 +1 @@ -docker build -t smebberson/alpine-consul-nginx /vagrant/alpine-consul-nginx +docker build -t smebberson/alpine-consul-nginx:local /vagrant/alpine-consul-nginx From f969a411b063060ba1e70ea6adf3f4452cf81722 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:16:19 +0930 Subject: [PATCH 13/17] Updated alpine-consul-nodejs to use the new alpine-consul-base. --- alpine-consul-nodejs/Dockerfile | 2 +- alpine-consul-nodejs/build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine-consul-nodejs/Dockerfile b/alpine-consul-nodejs/Dockerfile index 4f0d6fa..3805b8b 100644 --- a/alpine-consul-nodejs/Dockerfile +++ b/alpine-consul-nodejs/Dockerfile @@ -1,4 +1,4 @@ -FROM smebberson/alpine-consul-base:4.1.0 +FROM smebberson/alpine-consul-base:local MAINTAINER Scott Mebberson ENV NODE_VERSION=v6.10.1 NPM_VERSION=3 diff --git a/alpine-consul-nodejs/build b/alpine-consul-nodejs/build index b48dc9f..d6125da 100755 --- a/alpine-consul-nodejs/build +++ b/alpine-consul-nodejs/build @@ -1 +1 @@ -docker build -t smebberson/alpine-consul-nodejs /vagrant/alpine-consul-nodejs +docker build -t smebberson/alpine-consul-nodejs:local /vagrant/alpine-consul-nodejs From 8492dc19bf2ee960a4fbd4e56ed3e0b388335814 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:16:42 +0930 Subject: [PATCH 14/17] Updated alpine-consul-redis to use the new alpine-consul-base. --- alpine-consul-redis/Dockerfile | 6 ++++-- alpine-consul-redis/build | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/alpine-consul-redis/Dockerfile b/alpine-consul-redis/Dockerfile index 027c53d..605ea65 100644 --- a/alpine-consul-redis/Dockerfile +++ b/alpine-consul-redis/Dockerfile @@ -1,9 +1,11 @@ -FROM smebberson/alpine-consul-base:4.1.0 +FROM smebberson/alpine-consul-base:local MAINTAINER Scott Mebberson +ENV REDIS_VERSION=3.2.5-r0 + # Install redis. RUN apk upgrade --update --no-cache && \ - apk add --update --no-cache redis=3.2.0-r0 && \ + apk add --update --no-cache redis=$REDIS_VERSION && \ rm -rf /var/cache/apk/* && \ mkdir -p /data/redis && \ chown -R redis:redis /data/redis && \ diff --git a/alpine-consul-redis/build b/alpine-consul-redis/build index 1bd8f42..145e7b2 100755 --- a/alpine-consul-redis/build +++ b/alpine-consul-redis/build @@ -1 +1 @@ -docker build -t smebberson/alpine-consul-redis /vagrant/alpine-consul-redis +docker build -t smebberson/alpine-consul-redis:local /vagrant/alpine-consul-redis From ce75803416726fef35878a13d320a1d072f28b26 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:20:09 +0930 Subject: [PATCH 15/17] Updated alpine-consul-ui to reflect changes in alpine-consul. --- alpine-consul-ui/Dockerfile | 5 +++-- alpine-consul-ui/build | 2 +- alpine-consul-ui/root/etc/services.d/consul/run | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/alpine-consul-ui/Dockerfile b/alpine-consul-ui/Dockerfile index 8924309..b1f9019 100644 --- a/alpine-consul-ui/Dockerfile +++ b/alpine-consul-ui/Dockerfile @@ -1,7 +1,8 @@ -FROM smebberson/alpine-consul:3.1.0 +FROM smebberson/alpine-consul:local MAINTAINER Scott Mebberson -ENV CONSUL_CONFIG_DIR=/etc/consul.d +ENV CONSUL_DATA_DIR=/data/consul \ + CONSUL_CONFIG_DIR=/etc/consul.d # Add the files ADD root / diff --git a/alpine-consul-ui/build b/alpine-consul-ui/build index 2966ad5..6d15dc5 100755 --- a/alpine-consul-ui/build +++ b/alpine-consul-ui/build @@ -1 +1 @@ -docker build -t smebberson/alpine-consul-ui /vagrant/alpine-consul-ui +docker build -t smebberson/alpine-consul-ui:local /vagrant/alpine-consul-ui diff --git a/alpine-consul-ui/root/etc/services.d/consul/run b/alpine-consul-ui/root/etc/services.d/consul/run index 8c9c37f..bb326b9 100755 --- a/alpine-consul-ui/root/etc/services.d/consul/run +++ b/alpine-consul-ui/root/etc/services.d/consul/run @@ -17,4 +17,4 @@ RETRY_JOIN=`consul-join` CONSUL_JOIN_WAN=`consul-join-wan` # Start Consul in Server mode (see /etc/consul/conf.d/bootstrap/config.json). -s6-setuidgid consul consul agent -config-dir $CONSUL_CONFIG_DIR -bind $BIND -advertise $BIND -client $CONSUL_CLIENT $RETRY_JOIN -retry-interval $CONSUL_RETRY_INTERVAL -domain $CONSUL_DOMAIN -datacenter $CONSUL_DC $CONSUL_JOIN_WAN -ui +s6-setuidgid $CONSUL_RUNAS consul agent -node-id=$(consul-node-id) -data-dir=$CONSUL_DATA_DIR -config-dir $CONSUL_CONFIG_DIR -bind $BIND -advertise $BIND -client $CONSUL_CLIENT $RETRY_JOIN -retry-interval $CONSUL_RETRY_INTERVAL -domain $CONSUL_DOMAIN -datacenter $CONSUL_DC $CONSUL_JOIN_WAN -ui From bf14e3c42215effd5076d8d6139505f9b420af5a Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:20:54 +0930 Subject: [PATCH 16/17] Updated examples to test the new consul images. --- examples/complete/app/Dockerfile | 2 +- examples/complete/docker-compose.yml | 16 +++++++++++++--- examples/complete/run | 3 +-- examples/complete/static/Dockerfile | 2 +- examples/user-consul-redis/docker-compose.yml | 12 +++++++++--- examples/user-consul/Dockerfile | 2 +- examples/user-consul/run | 2 +- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/examples/complete/app/Dockerfile b/examples/complete/app/Dockerfile index 99de4f7..fc5176d 100644 --- a/examples/complete/app/Dockerfile +++ b/examples/complete/app/Dockerfile @@ -1,4 +1,4 @@ -FROM smebberson/alpine-consul-nodejs +FROM smebberson/alpine-consul-nodejs:local MAINTAINER Scott Mebberson # Build the npm modules. diff --git a/examples/complete/docker-compose.yml b/examples/complete/docker-compose.yml index e8c1644..e17cfab 100644 --- a/examples/complete/docker-compose.yml +++ b/examples/complete/docker-compose.yml @@ -2,21 +2,31 @@ version: '2' services: consul: - image: smebberson/alpine-consul + image: smebberson/alpine-consul:local restart: always + environment: + - CONSUL_BOOTSTRAP_DEBUG=true consului: - image: smebberson/alpine-consul-ui + image: smebberson/alpine-consul-ui:local ports: - 8500:8500 restart: always + environment: + - CONSUL_BOOTSTRAP_DEBUG=true static: build: ./static ports: - 80:80 restart: always + environment: + - CONSUL_BOOTSTRAP_DEBUG=true cache: - image: smebberson/alpine-consul-redis + image: smebberson/alpine-consul-redis:local restart: always + environment: + - CONSUL_BOOTSTRAP_DEBUG=true app: build: ./app restart: always + environment: + - CONSUL_BOOTSTRAP_DEBUG=true diff --git a/examples/complete/run b/examples/complete/run index 1dced35..e626b83 100755 --- a/examples/complete/run +++ b/examples/complete/run @@ -1,3 +1,2 @@ - # Start the example. -dc up -d && dc scale consul=3 app=3 && dc logs +dc up -d && dc scale consul=3 app=3 && dc logs -f diff --git a/examples/complete/static/Dockerfile b/examples/complete/static/Dockerfile index a95efe5..e3e7281 100644 --- a/examples/complete/static/Dockerfile +++ b/examples/complete/static/Dockerfile @@ -1,4 +1,4 @@ -FROM smebberson/alpine-consul-nginx +FROM smebberson/alpine-consul-nginx:local MAINTAINER Scott Mebberson # Add the files. diff --git a/examples/user-consul-redis/docker-compose.yml b/examples/user-consul-redis/docker-compose.yml index afa5283..12d1950 100644 --- a/examples/user-consul-redis/docker-compose.yml +++ b/examples/user-consul-redis/docker-compose.yml @@ -2,10 +2,16 @@ version: '2' services: consul: - image: smebberson/alpine-consul + image: smebberson/alpine-consul:local + environment: + - CONSUL_BOOTSTRAP_DEBUG=true consului: - image: smebberson/alpine-consul-ui + image: smebberson/alpine-consul-ui:local + environment: + - CONSUL_BOOTSTRAP_DEBUG=true ports: - 8500:8500 cache: - image: smebberson/alpine-consul-redis + image: smebberson/alpine-consul-redis:local + environment: + - CONSUL_BOOTSTRAP_DEBUG=true diff --git a/examples/user-consul/Dockerfile b/examples/user-consul/Dockerfile index 7ebbab7..d0508bc 100644 --- a/examples/user-consul/Dockerfile +++ b/examples/user-consul/Dockerfile @@ -1,2 +1,2 @@ -FROM smebberson/alpine-consul +FROM smebberson/alpine-consul:local MAINTAINER Scott Mebberson diff --git a/examples/user-consul/run b/examples/user-consul/run index 790862a..eaaa9fe 100755 --- a/examples/user-consul/run +++ b/examples/user-consul/run @@ -1,3 +1,3 @@ # run the user-consul image -docker run --rm --name user-consul smebberson/user-consul +docker run --detach --rm --name user-consul --env CONSUL_BOOTSTRAP_DEBUG=true --env CONSUL_AVAILABLE_SLEEP=5 smebberson/user-consul && docker logs --follow user-consul From b8c753ea4adf1929cbc5185b5d3a239c23976e86 Mon Sep 17 00:00:00 2001 From: Scott Mebberson Date: Fri, 9 Jun 2017 09:21:31 +0930 Subject: [PATCH 17/17] Updated the CHANGELOG with the recent updates. --- CHANGELOG.md | 18 ++++++++++++++++++ README.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 611fb53..6a7fe20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ Due to the nature of versioning and the fact this repository houses multiple Doc Each release records it's own specific changes in a VERSIONS.md file. +## 2017.06.08 + +- `alpine-consul-base`: updated consul-template configuration file to use a stanza rather than a string. + +## 2017.06.02 + +- `alpine-consul`, `alpine-consul-base`, `alpine-consul-ui`: + - upgraded to Consul `v0.8.3`. + - added the new `-data-id` argument (customisable via replacing the `/usr/bin/consul-node-id` script). + - added the `-data-dir` argument (customisable via the `CONSUL_DATA_DIR` ENV variable). + - exposed 8600 and 8600/udp. +- `alpine-consul-base`: added the `CONSUL_TEMPLATE_RUNAS` ENV variable to customise which user runs consul-template. +- `alpine-consul-base`: added the `CONSUL_RUNAS` ENV variable to customise which user runs consul. +- `alpine-consul-redis`: upgrade Redis to `v3.2.5-r0`. +- `alpine-consul`: added the `GO_DNSMASQ_RUNAS` ENV variable to customise which user runs go-dnsmasq. +- `alpine-consul`: added the `CONSUL_BOOTSTRAP_DEBUG` to show debug messages. Set to `true`. Information will be output by the `consul-available`, `consul-join` and `consul-join-wan` scripts. +- `alpine-consul`: added the `CONSUL_AVAILABLE_SLEEP` ENV variable to customise the amount of seconds to sleep between checking for other consul servers. + ## 2017.05.31 ### Releases diff --git a/README.md b/README.md index 4dc2b91..7515f4b 100644 --- a/README.md +++ b/README.md @@ -451,7 +451,7 @@ These images are a little different from your standard Docker images. The follow ### DNS search -By default, Alpine Linux doesn't support DNS `search`. This has been enabled through the use of `go-dnsmasq`. +By default, Alpine Linux <= v3.4 doesn't support DNS `search`. This has been enabled through the use of `go-dnsmasq`. ### Where is Bash?