forked from iost-official/go-iost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.run
53 lines (43 loc) · 1.52 KB
/
Dockerfile.run
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
FROM centos:7
ENV GOVERSION 1.10.1
# Install Git
RUN yum update -y && yum install wget git make gcc gcc-c++ kernel-devel redis -y
RUN git config --global user.name "IOST" && git config --global user.email "[email protected]"
# Install Redis
RUN \
cd /tmp && \
wget http://download.redis.io/redis-stable.tar.gz && \
tar xvzf redis-stable.tar.gz && \
cd redis-stable && \
make && \
make install && \
cp -f src/redis-sentinel /usr/local/bin && \
mkdir -p /etc/redis && \
cp -f *.conf /etc/redis && \
rm -rf /tmp/redis-stable* && \
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
# Install Go
RUN mkdir /goroot && \
mkdir /gopath && \
curl https://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz | \
tar xzf - -C /goroot --strip-components=1
ENV CGO_ENABLED 1
ENV GOPATH /gopath
ENV GOROOT /goroot
ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
# Install Python
RUN yum install -y epel-release
RUN yum install -y python python-devel python-pip
# Change redis conf
RUN sed -i 's/dir\ \.\//dir\ \/var\/lib\/iserver\//g' /etc/redis/redis.conf
#RUN sed -i 's/\#\ daemonize\ no/daemonize\ yes/g' /etc/redis/redis.conf
# Install project
RUN mkdir /workdir && mkdir /var/lib/iserver
COPY build/iserver /workdir/iserver
COPY build/register /workdir/register
COPY start.sh /workdir/start.sh
COPY iserver/iserver.yml /var/lib/iserver/iserver.yml
WORKDIR /workdir
CMD ["./start.sh"]