This repository has been archived by the owner on Jun 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
/
Dockerfile
57 lines (44 loc) · 1.98 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Riak
#
# VERSION 0.1.0
FROM ubuntu:precise
MAINTAINER Hector Castro [email protected]
# Update the APT cache
RUN sed -i.bak 's/main$/main universe/' /etc/apt/sources.list
RUN apt-get update
# Install and setup project dependencies
RUN apt-get install -y lsb-release openssh-server
RUN mkdir -p /var/run/sshd
RUN locale-gen en_US en_US.UTF-8
RUN echo 'root:basho' | chpasswd
# Add Basho's APT repository
ADD basho.apt.key /tmp/basho.apt.key
RUN apt-key add /tmp/basho.apt.key
RUN rm /tmp/basho.apt.key
RUN echo "deb http://apt.basho.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/basho.list
RUN apt-get update
# Install Riak and prepare it to run
RUN apt-get install -y riak
RUN sed -i.bak 's/127.0.0.1/0.0.0.0/' /etc/riak/app.config
RUN sed -i.bak 's/{anti_entropy_concurrency, 2}/{anti_entropy_concurrency, 1}/' /etc/riak/app.config
RUN sed -i.bak 's/{map_js_vm_count, 8 }/{map_js_vm_count, 0 }/' /etc/riak/app.config
RUN sed -i.bak 's/{reduce_js_vm_count, 6 }/{reduce_js_vm_count, 0 }/' /etc/riak/app.config
RUN sed -i.bak 's/{hook_js_vm_count, 2 }/{hook_js_vm_count, 0 }/' /etc/riak/app.config
RUN sed -i.bak "s/##+zdbbl/+zdbbl/" /etc/riak/vm.args
# ulimits
RUN echo "ulimit -n 4096" >> /etc/default/riak
# sysctl
RUN echo "vm.swappiness = 0" > /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_max_syn_backlog = 40000" >> /etc/sysctl.d/riak.conf && \
echo "net.core.somaxconn = 40000" >> /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_sack = 1" >> /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_window_scaling = 1" >> /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_fin_timeout = 15" >> /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_keepalive_intvl = 30" >> /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_tw_reuse = 1" >> /etc/sysctl.d/riak.conf && \
echo "net.ipv4.tcp_moderate_rcvbuf = 1" >> /etc/sysctl.d/riak.conf && \
sysctl -e -p /etc/sysctl.d/riak.conf
# Open ports for ssh and Riak (HTTP)
EXPOSE 22 8098
ADD bin/boot.sh /
CMD ["/bin/bash", "/boot.sh"]