forked from opensourceways/mirrorbits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (33 loc) · 1.68 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
FROM openeuler/openeuler:21.03
LABEL maintainer="[email protected]"
RUN mkdir -p /go/bin && mkdir -p /go/src/mirrorbits
RUN yum -y update
RUN yum install -y sudo
RUN sudo yum install -y go
ENV GOROOT=/usr/lib/golang
ENV PATH=$PATH:/usr/lib/golang/bin
ENV GOPATH=/go
ENV PATH=$GOPATH/bin/:$PATH
RUN sudo yum install -y gcc make && sudo yum install -y pkg-config git zlib autoconf automake libtool curl g++ unzip protobuf-compiler rsync python3 python3-pip python3-devel
RUN pip install pyyaml prettytable && sudo yum install -y redis
# install geoipupdate binary, NOTE: default configuration file located at /usr/local/etc/GeoIP.conf
# and geoip folder is /usr/share/GeoIP env GO111MODULE=on go get github.com/maxmind/geoipupdate/v4/cmd/geoipupdate
ENV GO111MODULE=on
RUN go get github.com/maxmind/geoipupdate/v4/cmd/geoipupdate && \
mkdir -p /usr/share/GeoIP
COPY . /go/src/mirrorbits
RUN mkdir -p /srv/repo /var/log/mirrorbits && \
cd /go/src/mirrorbits && make && \
make install PREFIX=/usr
RUN cp /go/src/mirrorbits/contrib/docker/mirrorbits.conf /etc/mirrorbits.conf
COPY scripts /
RUN cd / && git clone https://github.com/protocolbuffers/protobuf.git
RUN cd /protobuf && git submodule update --init --recursive && chmod 755 autogen.sh && ./autogen.sh && chmod 755 configure && ./configure --prefix=/usr/local/protobuf && make && make install
ENV PATH=$PATH:/usr/local/protobuf/bin
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib
ENV LIBRARY_PATH=$LIBRARY_PATH:/usr/local/protobuf/lib
RUN cd / && git clone https://github.com/tj/git-extras.git
ENV PATH=$PATH:/git-extras/bin
RUN /git-extras/bin/git-extras update
ENTRYPOINT /usr/bin/mirrorbits daemon -config /etc/mirrorbits.conf
EXPOSE 8080