This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
/
Dockerfile
58 lines (48 loc) · 1.8 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
FROM golang:1.15.6-buster
ARG VERSION
ENV GOPATH /go
COPY . ${GOPATH}/src/github.com/mosuka/blast
RUN echo "deb http://ftp.us.debian.org/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
git \
# golang \
libicu-dev \
libstemmer-dev \
gcc-4.8 \
g++-4.8 \
build-essential && \
apt-get clean && \
#update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 80 && \
#update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 80 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 && \
go get -u -v github.com/blevesearch/cld2 && \
cd ${GOPATH}/src/github.com/blevesearch/cld2 && \
git clone https://github.com/CLD2Owners/cld2.git && \
cd cld2/internal && \
./compile_libs.sh && \
cp *.so /usr/local/lib && \
cd ${GOPATH}/src/github.com/mosuka/blast && \
make GOOS=linux \
GOARCH=amd64 \
CGO_ENABLED=1 \
BUILD_TAGS="kagome icu libstemmer cld2" \
VERSION="${VERSION}" \
build
FROM debian:buster-slim
MAINTAINER Minoru Osuka "minoru.osuka@gmail.com"
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
libicu-dev \
libstemmer-dev && \
apt-get clean && \
rm -rf /var/cache/apk/*
COPY --from=0 /go/src/github.com/blevesearch/cld2/cld2/internal/*.so /usr/local/lib/
COPY --from=0 /go/src/github.com/mosuka/blast/bin/* /usr/bin/
EXPOSE 7000 8000 9000
ENTRYPOINT [ "/usr/bin/blast" ]
CMD [ "start" ]