-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (43 loc) · 1.84 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
58
59
60
61
62
63
# Core image
FROM ubuntu:16.04
LABEL io.k8s.description="3 Node Redis Cluster" \
io.k8s.display-name="Redis Cluster" \
io.openshift.expose-services="6379:tcp" \
io.openshift.tags="redis-cluster"
RUN groupadd -r redis && useradd -r -g redis -d /home/redis -m redis
# Install dependencies
RUN apt-get update && apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties software-properties-common libffi-dev nodejs
# Install Ruby
RUN apt-get update && apt-get install -y ruby ruby-dev ruby-bundler
RUN rm -rf /var/lib/apt/lists/*
RUN echo $(ruby -v)
# Install Rails
#RUN gem update --system
#RUN gem install bundler
#RUN gem install rails
#RUN echo $(rails -v)
RUN apt-get update -y && \
apt-get install -y make gcc && apt clean all
RUN echo "151.101.64.70 rubygems.org">> /etc/hosts && \
gem install redis
WORKDIR /usr/local/src/
RUN curl -o redis-3.2.6.tar.gz http://download.redis.io/releases/redis-3.2.6.tar.gz && \
tar xzf redis-3.2.6.tar.gz && \
cd redis-3.2.6 && \
make MALLOC=libc
RUN for file in $(grep -r --exclude=*.h --exclude=*.o /usr/local/src/redis-3.2.6/src | awk {'print $3'}); do cp $file /usr/local/bin; done && \
cp /usr/local/src/redis-3.2.6/src/redis-trib.rb /usr/local/bin && \
cp -r /usr/local/src/redis-3.2.6/utils /usr/local/bin && \
rm -rf /usr/local/src/redis*
COPY src/redis.conf /usr/local/etc/redis.conf
COPY src/*.sh /usr/local/bin/
COPY src/redis-trib.rb /usr/local/bin/
RUN mkdir /data && chown redis:redis /data && \
chown -R redis:redis /usr/local/bin/ && \
chown -R redis:redis /usr/local/etc/ && \
chmod +x /usr/local/bin/cluster-init.sh /usr/local/bin/redis-trib.rb
VOLUME /data
WORKDIR /data
USER redis
EXPOSE 6379 16379
CMD [ "redis-server", "/usr/local/etc/redis.conf" ]