A Docker image designed for extending from when you need to run Consul, based on Alpine Linux. This image belongs to a suite of images documented here.
This image is designed to be extended from, with specific services added to it via Consul, along with appropriate health checks.
Image size is ~49.4 MB.
This image features:
- Alpine Linux
- s6 and s6-overlay
- Consul and consul-template
4.2.0
,latest
(Dockerfile)4.1.1
(Dockerfile)4.1.0
(Dockerfile)4.0.0
(Dockerfile)3.0.0
(Dockerfile)2.0.0
(Dockerfile)1.1.0
(Dockerfile)1.0.0
(Dockerfile)
See VERSIONS.md for image contents.
To use this image include FROM smebberson/alpine-consul-base
at the top of your Dockerfile
, or simply docker run --name consul-base smebberson/alpine-consul-base
.
This container has been setup to automatically connect to a Consul cluster, created with a service name of consul
. Read more about it here.
consul-template is automatically started if templates are available.
To use consul-template:
- Add your templates to
root/etc/consul-template/templates/my-service/
. - Make
consul-template
configuration aware of your templates by adding a configuration file inroot/etc/consul-template/conf.d/my-service
(use sub folders to makeVOLUME /etc/consul-template/templates/my-service
possible). - In your
Dockerfile
be sure to runmkfifo /etc/services.d/my-service/supervise/control
andchmod g+w /etc/services.d/my-service/supervise/control
in order to make it possible forconsul-template
to restart the service if needed.
An example of using this image can be found in examples/user-consul-nginx-nodejs.