Sign inSign up

flyingflip/rethinkdb

By flyingflip

Updated about 10 hours ago

RethinkDB Docker Image with Python Libraries as well as import/export

Image
Databases & storage
0

808

flyingflip/rethinkdb repository overview

Quick reference

Maintained by: FlyingFlip Studios, LLC

Official Web Site: RethinkDB

Source and Dockerfile: github.com/flyingflip/rethinkdb

Supported tags

  • 2.4.4, latest - multi-architecture tag that pulls the matching arm64 or amd64 image for your CPU
  • 2.4.1-arm, 2.4.2-arm, 2.4.3-arm, 2.4.4-arm - arm64 only
  • 2.4.1-amd, 2.4.2-amd, 2.4.3-amd, 2.4.4-amd - amd64 only

Current Version: 2.4.4

What is RethinkDB?

RethinkDB is an open-source, distributed database built to store JSON documents and effortlessly scale to multiple machines. It's easy to set up and learn and features a simple but powerful query language that supports table joins, groupings, aggregations, and functions.

What is in this image

This image is a drop-in replacement for the official RethinkDB image. It runs the same RethinkDB 2.4.4 server, exposes the same ports and uses the same /data volume, so the official documentation applies.

It differs from the official image in two ways:

  • It is published for arm64 as well as amd64. Upstream RethinkDB does not publish ARM builds, so treat the arm64 image as community supported and use it at your own discretion.
  • It includes the RethinkDB Python tools for backup, restore, export and import, which the official image leaves out. See Backup and restore below.

The image is built on Alpine Linux 3.22 with RethinkDB compiled from source.

How to use this image

Start an instance with data mounted in the working directory

The default command is rethinkdb --bind all, so the RethinkDB daemon binds to all network interfaces available to the container. By default RethinkDB only accepts connections from localhost, which would make it unreachable from outside the container.

docker run --name rethinkdb -p 8080:8080 -d -v "$PWD:/data" flyingflip/rethinkdb

Data is written to /data inside the container. Mount a host directory or a named volume there so the database survives the container being removed.

Ports

PortPurpose
8080Web administration UI
28015Client driver connections
29015Intracluster connections between servers

Publish 28015 as well if your application connects from outside Docker:

docker run --name rethinkdb -p 8080:8080 -p 28015:28015 -d -v "$PWD:/data" flyingflip/rethinkdb

Passing options to RethinkDB

The server binary lives at /opt/bin/rethinkdb and is not on the container's PATH. When you override the command, use the full path and remember to keep --bind all:

docker run --name rethinkdb -p 8080:8080 -d -v "$PWD:/data" flyingflip/rethinkdb \
  /opt/bin/rethinkdb --bind all --cache-size 2048

See the command line options for everything RethinkDB accepts.

Joining a cluster

Start a second server and point it at the first one's intracluster port:

docker run --name rethinkdb-2 -d -v "$PWD/data2:/data" flyingflip/rethinkdb \
  /opt/bin/rethinkdb --join <ip-of-first-server>:29015 --bind all

docker-compose.yml example using network mode

services:
  rethinkdb:
    image: flyingflip/rethinkdb
    container_name: rethinkdb
    volumes:
      - ./data:/data
    network_mode: host
    restart: unless-stopped

docker-compose.yml example with port mapping

services:
  rethinkdb:
    image: flyingflip/rethinkdb
    container_name: rethinkdb
    volumes:
      - ./data:/data
    ports:
      - "8080:8080"
      - "28015:28015"
    networks:
      - rethinkdb
    restart: unless-stopped
networks:
  rethinkdb: {}

Backup and restore

The image ships the RethinkDB Python tools at /root/.local/bin. Run them with docker exec against a running container. Writing the archive under /data puts it on your mounted volume, so it is available on the host.

Back up every database on the server:

docker exec rethinkdb /root/.local/bin/rethinkdb-dump -c localhost:28015 -f /data/backup.tar.gz

Restore from an archive, overwriting existing tables:

docker exec rethinkdb /root/.local/bin/rethinkdb-restore -c localhost:28015 --force /data/backup.tar.gz

Export a single table to JSON, and import it again:

docker exec rethinkdb /root/.local/bin/rethinkdb-export -c localhost:28015 -e mydb.mytable -d /data/export
docker exec rethinkdb /root/.local/bin/rethinkdb-import -c localhost:28015 -d /data/export

Add -p to any of these commands to be prompted for the admin password if you have set one. The tools available are rethinkdb-dump, rethinkdb-restore, rethinkdb-export, rethinkdb-import, rethinkdb-index-rebuild and rethinkdb-repl. Their options are documented in the backup and import and export guides.

Platform notes

RethinkDB does not run under CPU emulation. On an Apple Silicon Mac, the amd64 image hangs at startup under Docker Desktop's emulation, as does the official rethinkdb image. Use the latest or 2.4.4 tag, which pulls the native arm64 image, or pin to a -arm tag.

Configuration

See the official docs for information on using and configuring a RethinkDB cluster.

License

View license information for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in the repo-info repository's rethinkdb/ directory.

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Tag summary

Content type

Image

Digest

sha256:5af11cfe2

Size

646.6 MB

Last updated

about 10 hours ago

docker pull flyingflip/rethinkdb