Public Repository

Last pushed: 4 months ago
Short Description
Statically built Rqlite
Full Description

This is a custom rqlite container without a heavy OS container (Built off scratch, size=16.83 MB).
Latest commit b8498856b21cf60561d5306b9b52dcef98eae486 (v3.14.0 is going out)

Why not use Rqlite?
Because you always need to write to the master instead of any node...

Origin of source
https://github.com/rqlite/rqlite

Installing it in the real world

NODE1
IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
docker pull mpdroog/rqlite
docker rm roach1
docker run \
--name=roach1 \
-p 4001:4001 -p 4002:4002 \
-v "${PWD}/rqlite/roach1:/db" \
mpdroog/rqlite \
-http 0.0.0.0:4001 -httpadv $IP:4001 -raft 0.0.0.0:4002 -raftadv $IP:4002 \
/db/main.sqlite

NODE2
IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
docker pull mpdroog/rqlite
docker rm roach2
docker run \
--name=roach2 \
-p 4001:4001 -p 4002:4002 \
-v "${PWD}/rqlite/roach2:/db" \
mpdroog/rqlite \
-http 0.0.0.0:4001 -httpadv $IP:4001 -raft 0.0.0.0:4002 -raftadv $IP:4002 \
-join http://NODE1IPHERE:4001 \
/db/main.sqlite

NODE3
IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
docker pull mpdroog/rqlite
docker rm roach3
docker run \
--name=roach3 \
-p 4001:4001 -p 4002:4002 \
-v "${PWD}/rqlite/roach3:/db" \
mpdroog/rqlite \
-http 0.0.0.0:4001 -httpadv $IP:4001 -raft 0.0.0.0:4002 -raftadv $IP:4002 \
-join http://NODE1IPHERE:4001 \
/db/main.sqlite

compile.sh

go build --ldflags '-extldflags "-static"'
COMMIT=$(git rev-parse HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
docker build . -t "mpdroog/rqlite" --build-arg GIT_COMMIT="$BRANCH-$COMMIT"
docker push mpdroog/rqlite

Dockerfile

FROM scratch
MAINTAINER mpdroog <rootdev@gmail.com>
ADD rqlited /rqlited
ADD cacert.pem /etc/ssl/certs/ca-certificates.crt

ARG GIT_COMMIT=unknown
LABEL git-commit=$GIT_COMMIT

EXPOSE 4001
EXPOSE 4002
ENTRYPOINT ["/rqlited"]

Docker Pull Command
Owner
mpdroog

Comments (0)