Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ 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

- [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`.

### 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`.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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?

Expand Down
3 changes: 2 additions & 1 deletion alpine-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions alpine-consul-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM smebberson/alpine-consul:3.1.1
FROM smebberson/alpine-consul:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

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
Expand Down
2 changes: 1 addition & 1 deletion alpine-consul-base/build
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
consul = "127.0.0.1:8500"
consul {
address = "127.0.0.1:8500"
}
5 changes: 5 additions & 0 deletions alpine-consul-base/root/etc/cont-init.d/00-consul-template
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion alpine-consul-base/root/etc/services.d/consul-template/run
Original file line number Diff line number Diff line change
Expand Up @@ -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/
4 changes: 2 additions & 2 deletions alpine-consul-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM smebberson/alpine-consul-base:4.1.0
FROM smebberson/alpine-consul-base:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

# Install nginx
Expand All @@ -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/ && \
Expand Down
2 changes: 1 addition & 1 deletion alpine-consul-nginx/build
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion alpine-consul-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM smebberson/alpine-consul-base:4.1.0
FROM smebberson/alpine-consul-base:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

ENV NODE_VERSION=v6.10.1 NPM_VERSION=3
Expand Down
2 changes: 1 addition & 1 deletion alpine-consul-nodejs/build
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions alpine-consul-redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM smebberson/alpine-consul-base:4.1.0
FROM smebberson/alpine-consul-base:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

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 && \
Expand Down
2 changes: 1 addition & 1 deletion alpine-consul-redis/build
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions alpine-consul-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM smebberson/alpine-consul:3.1.0
FROM smebberson/alpine-consul:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

ENV CONSUL_CONFIG_DIR=/etc/consul.d
ENV CONSUL_DATA_DIR=/data/consul \
CONSUL_CONFIG_DIR=/etc/consul.d

# Add the files
ADD root /
2 changes: 1 addition & 1 deletion alpine-consul-ui/build
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion alpine-consul-ui/root/etc/services.d/consul/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions alpine-consul/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM smebberson/alpine-base:3.1.0
FROM smebberson/alpine-base:3.2.0
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

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 \
Expand All @@ -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
2 changes: 1 addition & 1 deletion alpine-consul/build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build -t smebberson/alpine-consul /vagrant/alpine-consul
docker build -t smebberson/alpine-consul:local /vagrant/alpine-consul
4 changes: 0 additions & 4 deletions alpine-consul/root/etc/cont-finish.d/00-consul

This file was deleted.

11 changes: 11 additions & 0 deletions alpine-consul/root/etc/cont-init.d/30-consul
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/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
fi
3 changes: 3 additions & 0 deletions alpine-consul/root/etc/cont-init.d/40-consul
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv sh

mkdir -p `dirname $CONSUL_BOOTSTRAP_LOG_FILE`
2 changes: 1 addition & 1 deletion alpine-consul/root/etc/services.d/consul/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion alpine-consul/root/etc/services.d/resolver/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 11 additions & 1 deletion alpine-consul/root/usr/bin/consul-available
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
# 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.
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
10 changes: 10 additions & 0 deletions alpine-consul/root/usr/bin/consul-debug
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions alpine-consul/root/usr/bin/consul-join
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if test -z "$JOIN"; then
exit 1;
fi

# Output debug messages if required.
consul-debug "[consul-join] $JOIN"

# We found at least one. Exit 0!
echo "$JOIN"
exit 0
2 changes: 2 additions & 0 deletions alpine-consul/root/usr/bin/consul-join-wan
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ if [ "$CONSUL_ADVERTISE_WAN" ]; then
EXTRA=$EXTRA" -advertise-wan $CONSUL_ADVERTISE_WAN"
fi

consul-debug "[consul-join] $JOIN"

echo "$EXTRA"
exit 0
15 changes: 15 additions & 0 deletions alpine-consul/root/usr/bin/consul-node-id
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/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.
consul-debug "[consul-node-id] node-id: $NODE_ID..."

echo $NODE_ID
exit 0
2 changes: 1 addition & 1 deletion alpine-nginx-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM smebberson/alpine-nginx:3.0.0
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

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 && \
Expand Down
1 change: 1 addition & 0 deletions alpine-nginx-nodejs/NODEJS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion alpine-nginx-nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 10 additions & 1 deletion alpine-nginx-nodejs/VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM smebberson/alpine-consul-nodejs
FROM smebberson/alpine-consul-nodejs:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

# Build the npm modules.
Expand Down
16 changes: 13 additions & 3 deletions examples/complete/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions examples/complete/run
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/complete/static/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM smebberson/alpine-consul-nginx
FROM smebberson/alpine-consul-nginx:local
MAINTAINER Scott Mebberson <scott@scottmebberson.com>

# Add the files.
Expand Down
Loading