Skip to content

Instantly share code, notes, and snippets.

@diyan
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diyan/11042188 to your computer and use it in GitHub Desktop.
Save diyan/11042188 to your computer and use it in GitHub Desktop.
Dockerfile for Riak test server. Rekon installed, HTTP / Protocol Buffers, Riak Search, LevelDB backend are enabled
FROM ubuntu:14.04
MAINTAINER Alexey Diyan alexey.diyan@dev-pro.net
### NOTE. Command ./run.sh will rebuild this container
### OS. Apply Docker workarounds, update the APT cache
# http://crosbymichael.com/dockerfile-best-practices-take-2.html
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'root:root' | chpasswd
RUN locale-gen en_US en_US.UTF-8
RUN apt-get update && apt-get install -y curl
### Riak. Installation
RUN curl -s http://apt.basho.com/gpg/basho.apt.key | apt-key add --
RUN echo "deb http://apt.basho.com precise main" | tee /etc/apt/sources.list.d/basho.list
RUN apt-get update && apt-get install -y riak
RUN echo 'service riak start && riak-admin wait-for-service riak_search riak@127.0.0.1' > ~/riak_start.sh
RUN chmod +x ~/riak_start.sh
### Riak. Setup configuration
# Make lodash avaiable in Map/Reduce
# TODO Consider change js_source_dir location in config
RUN mkdir -p /tmp/js_source
RUN curl -sL https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.min.js > /tmp/js_source/lodash.min.js
# Listen on all interfaces
RUN sed -i s/127.0.0.1/0.0.0.0/g /etc/riak/app.config
# Use LevelDB instead of BitCask as the riak backend
RUN sed -i s/riak_kv_bitcask_backend/riak_kv_eleveldb_backend/g /etc/riak/app.config
# Enable Riak Search
RUN sed -i '/{riak_search/,/{enabled/s/false}/true}/' /etc/riak/app.config
# Enable Riak Control
RUN sed -i '/{riak_control/,/{enabled/s/false}/true}/' /etc/riak/app.config
# Disable authentication for Riak Control
RUN sed -i '/{riak_control/,/{auth/s/userlist}/none}/' /etc/riak/app.config
# Change open files limit for current session as required by Riak
# http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/
RUN echo "ulimit -n 4096" | tee -a /etc/default/riak
ENV RIAK_NODE_NAME "127.0.0.1"
### Riak. Adjust test server configuration
# https://github.com/basho/riak-python-client/blob/master/riak/test_server.py
# Small ring size makes start faster
RUN sed -i 's/%{ring_creation_size, 64}/{ring_creation_size, 4}/' /etc/riak/app.config
# Change HTTP, Protocol Buffers and Handoff ports for test server
RUN sed -i /{http/s/8098/9000/ /etc/riak/app.config
RUN sed -i /{handoff_port/s/8099/9001/ /etc/riak/app.config
RUN sed -i /{pb/s/8087/9002/ /etc/riak/app.config
### Rekon. Web-based GUI. Installation
RUN ~/riak_start.sh && curl -sL rekon.basho.com | node=127.0.0.1:9000 sh 2>/dev/null
# Expose HTTP, Protocol Buffers and Handoff ports
EXPOSE 9000 9001 9002
CMD ~/riak_start.sh && bash
@diyan
Copy link
Author

diyan commented Jun 20, 2014

This Dockerfile is not up-to-date. I will update it with much better version soon.

@diyan
Copy link
Author

diyan commented Jun 26, 2014

Done

@leentorenvliet
Copy link

Unfortunately curl rekon.basho.com | sh no longer works since they moved the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment