RethinkDB on Docker

There are a number of Dockerfiles listed on the official website of RethinkDB.  These files are quite similar, but the one that seems to be most upto date is from dockerfile (follow brief instructions there to setup and run the rethinkdb container).

Run Container (1st time)

# run rethinkdb for the first time
docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 dockerfile/rethinkdb

Make sure the db is running by visiting http://localhost:8080/

Consequent Container Runs

IMPORTANT: when you start (not run) the container again you should refer to the container-id (could be found by “docker ps -a”); this is because the data-volume is connected to a specific container; running “dockerfile/rethinkdb” will create a new data volume (so the data you’ve created earlier would not be shown).  A more detailed explanation is in the comments by “Rich N”.

docker start CONTAIER-ID_FROM-PREVIOUS-RUN

Import Data

Now you need to install RethinkDB drivers on your machine (not the docker container); so that you can load/import data into the db.  Here are the instructions for ubuntu (you may also need to install rethinkdb locally):

sudo apt-get install python-pip
sudo pip install rethinkdb

[ref]

Details

Here the flow is a little bit different from what you would normally do — ssh to the server and loading data on the server (for speed purposes).  Instead you would import data from your local machine into the docker container:

rethinkdb import -f users.json --table test.users

Moreover, running bash on the container (docker attach) doesn’t work since rethinkdb is specified as container’s entry point (and not bin/bash); this is done so that container would resemble the behaviour of a binary file (ref: 5. CMD and ENTRYPOINT better together).

OLD (Deprecated)

http://dockerfile.github.io/#/rethinkdb

copy the Dockerfile locally from https://github.com/dockerfile/rethinkdb/blob/master/Dockerfile

to get the newest version replace the

  add-apt-repository -y ppa:rethinkdb/ppa && \

with

  add-apt-repository -y http://download.rethinkdb.com/apt && \

keywords:

newest version 1.12 1.13 rethinkdb docker ubuntu apt-get

Error when launching rethinkdb-import: No such file or directory
The rethinkdb-import command depends on the RethinkDB Python driver, which must be installed.
Instructions for installing the RethinkDB Python driver are available here:
http://www.rethinkdb.com/docs/install-drivers/python/

Error when launching ‘rethinkdb-import’: No such file or directory

ubuntu install pip

Searched for rethinkdb docker 9:07am
Integrations – RethinkDB – rethinkdb.com 9:23pm
RethinkDB on Docker | Active Intelligence – activeintelligence.org 9:27pm
Welcome to wercker – Docker – wercker.com 9:27pm
Docker – RethinkDB recipe | {jz} John Zanchetta – wordpress.com 9:27pm
Quickstart · shipyard – shipyard-project.com 9:27pm
How can i run rethinkdb-dump/export in… – stackoverflow.com 9:27pm
http://kemstack.co.in/wordpress/zalk/2014/12/…
earched for ubuntu install pip 9:52pm
Installation — pip 6.0.3 documentation – pypa.io 9:53pm
software installation – How to install… – askubuntu.com 9:53pm
Searched for Error when launching ‘rethinkdb-import’: No such file or directory 9:51pm
RethinkDB the importing json process… – github.io 9:51pm
Newest ‘rethinkdb’ Questions – Stack Overflow – stackoverflow.com
Searched for docker attach entrypoint 7:25pm
Run Reference – Docker Documentation – docker.com 7:25pm
Searched for docker exec 7:20pm
Docker exec runs command on host machine… – stackoverflow.com
Searched for docker attach 7:18pm
Let the Other 95% of Great Programmers… – paulgraham.com 6:59pm
Searched for docker entrypoint 6:49pm
docker – What is the difference between… – stackoverflow.com 6:49pm
Searched for docker attach no prompt 4:12pm
How to keep a Docker container running?… – stackoverflow.com 4:12pm
ubuntu – Docker: bash terminal starts… – stackoverflow.com 4:13pm
Interacting with container (attach) to… – github.com 4:13pm
Searched for rethinkdb import json 4:05pm
Importing your data – RethinkDB – rethinkdb.com 4:05pm
Searched for rethinkdb 4:05pm
Searched for docker rethinkdb 4:00pm
Integrations – RethinkDB – rethinkdb.com 4:00pm
Searched for docker run bash 3:55pm
Getting Started with docker – CoreOS – coreos.com 3:55pm
Docker. How to get bash\ssh inside runned… – askubuntu.com 3:57pm
python – Docker interactive mode and… – stackoverflow.com
Searched for docker volume 3:39pm
Managing data in containers – Docker… – docker.com 3:40pm
Searched for docker rethinkdb 3:36pm
dockerfile/rethinkdb · GitHub – github.com 3:36pm
Searched for docker attach doesnt work 3:33pm
How do you attach and detach from Docker’s… – stackoverflow.com 3:33pm
Control-C while running `docker attach`… – github.com 3:33pm
Bug 1113608 – `docker attach` hangs… – redhat.com 3:33pm
Searched for docker connect no prompt 3:30pm
how to get the terminal of a running… – google.com 3:30pm
10 Docker Tips and Tricks That Will Make… – nathanleclaire.com 3:30pm
Searched for docker rethinkdb connect 3:26pm
Deploying RethinkDB applications with… – rethinkdb.com 3:26pm
Dockerfile Best Practices – Michael Crosby – crosbymichael.com 3:26pm
How can i run rethinkdb-dump/export in… – stackoverflow.com 3:26pm
Searched for docker rethinkdb import 3:23pm
RethinkDB on Docker | Active Intelligence – activeintelligence.org 3:07pm
Building and testing a cluster of RethinkDB… – wercker.com 3:07pm
Docker.io – SlideShare – slideshare.net 3:08pm
RethinkDB the importing json process… – github.io 3:08pm
How To Create a Sharded RethinkDB Cluster… – digitalocean.com
Searched for docker attach terminal 3:20pm
Searched for docker ssh to running container 3:12pm
Docker. How to get bash\ssh inside runned… – askubuntu.com 3:12pm
Searched for connect to docker 3:11pm
Docker basics – Docker Documentation – docker.com 3:11pm
Searched for rethinkdb docker 3:05pm
Searched for rethinkdb import json 3:03pm
Importing your data – RethinkDB – rethinkdb.com
Searched for docker data volume does not persist 9:00pm
Docker In-depth: Volumes · Container42 – tech-d.net 9:01pm
How to deal with persistent storage (e.g…. – stackoverflow.com 9:01pm
How do I deploy a docker container and… – serverfault.com 9:01pm
Alex Collins – Docker – Persistence – alexecollins.com 9:01pm
Why Docker Data Containers are Good — Medium – medium.com 9:01pm
Persistent Storage in Docker – Under… – blogspot.com 9:02pm

 

 

About Neil Rubens

see http://ActiveIntelligence.org

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*