Skip to content

Files

Latest commit

fae112a · Mar 26, 2025

History

History

serf

serf-container

serf is a decentralized solution for service discovery and orchestration that is lightweight, highly available, and fault tolerant.

This repository provides a Dockerfile to build a container image for Serf.

Usage

Prepare the following Serf Configuration file

{
  "node_name": "localhost",
  "rpc_addr": "0.0.0.0:7373",
  "tags": {
    "role": "load-balancer",
    "datacenter": "east"
  }
}

To launch serf server by docker run:

$ docker run -d --rm --read-only --name serf \
   --mount type=bind,source=/your/config,target=/serf/config \
   -p 7373:7373 -p 7946:7946 \
   ghcr.io/cybozu/serf:0.10 \
     agent -config-dir=/serf/config

To use serf cli, first install it in a host OS directory DIR:

$ docker run --rm -u root:root \
  --entrypoint /usr/local/serf/install-tools \
  --mount type=bind,source=DIR,target=/host \
  ghcr.io/cybozu/serf:0.10

Then run serf as follows:

$ DIR/serf members

Docker images

Docker images are available on ghcr.io