Public | Automated Build

Last pushed: a year ago
Short Description
Alpine Consul Image
Full Description

alpine-consul

A Docker image for running consul, based on Alpine Linux.
This image belongs to a suite of images documented here.

Image size is ~36.9 MB.

Features

This image features:

Versions

See VERSIONS.md for image contents.

Usage

To use this image include FROM smebberson/alpine-consul at the top of your Dockerfile, or simply docker run --name consul smebberson/alpine-consul.

By default, Consul has been configured with zero-conf Consul bootstrapping (to take advantage of zero-conf Consul bootstrapping, Docker 1.10+ is required).

To use this image to setup a Consul cluster with 3 nodes via Docker Compose, add the following to your docker-compose.yml file:

version: '2'

services:
    consul:
        image: smebberson/alpine-consul:dev

Then start with dc up -d && dc scale consul=3. You don't need to worry about bootstrapping the Consul cluster, everything just works.

Customisation

This container comes setup as follows:

  • Consul will automatically start.
  • If Consul dies, it will automatically be restarted (the container will remain running).

All configuration has been defined in the root/etc/consul/conf.d/bootstrap/config.json file.

To customise configuration for consul, replace the file at root/etc/consul/conf.d/bootstrap/config.json with your own configuration.

To customise the start script for consul, replace the file at root/etc/services.d/consul/run with your own start script.

Consul DNS domain

By default, Consul's DNS domain is consul.. This allows you to make DNS queries such as nginx.service.consul to find all IPs relating to the nginx service (for example). Through customizing the environment variable CONSUL_DOMAIN you can alter Consul's DNS domain.

For example, add ENV CONSUL_DOMAIN=dockeralpine to your Dockerfile and you'll be able to make a DNS query for nginx.service.dockeralpine rather than the default.

You can read more about Consul's DNS interface here.

Example

An example of using this image can be found in examples/user-confd.

Docker Pull Command
Owner
solvebio
Source Repository

Comments (0)