-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
90 lines (79 loc) · 3.88 KB
/
Copy pathDockerfile
File metadata and controls
90 lines (79 loc) · 3.88 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM manticoresearch/manticore-executor:0.6.9-dev
ARG TARGET_ARCH='amd64'
ARG MANTICORE_REV='c86d78c3dd0a21705afc1130deb6f47f7b2b9e6f'
ARG COLUMNAR_REV='8171c1adecb46fb7144618b403e49b6ec4b683ec'
ARG BUDDY_REV='84766dfcb972b44da62f0237a632b5a02e55e01d'
ENV EXECUTOR_VERSION='0.6.9-230330-35089f4'
# Build manticore and columnar first
ENV BUILD_DEPS="autoconf automake cmake alpine-sdk openssl-dev bison flex git boost-static boost-dev zstd-dev curl-dev"
RUN apk update && apk add curl gcc vim libcurl $BUILD_DEPS && \
git clone https://github.com/manticoresoftware/columnar.git && \
cd columnar && \
git checkout $COLUMNAR_REV && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GALERA=0 -DBUILD_TESTING=OFF .. && \
make -j8 && make install && cd ../.. && rm -fr columnar && \
rm -f /usr/local/lib/libcurl.* && \
rm -f /usr/local/bin/curl && \
git clone https://github.com/manticoresoftware/manticoresearch.git && \
cd manticoresearch && \
git checkout $MANTICORE_REV && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GALERA=0 -DBUILD_TESTING=OFF .. && \
make -j8 && make install && cd ../.. && rm -fr manticoresearch && \
apk del $BUILD_DEPS && \
rm -fr /var/cache/apk/* && \
cp /usr/local/etc/manticoresearch/manticore.conf /etc/manticore.conf
# Get production version and keep dev for executor
RUN apk update && \
apk add bash mysql-client iproute2 \
apache2-utils coreutils neovim git && \
mv /usr/bin/manticore-executor /usr/bin/manticore-executor-dev && \
ln -sf /usr/bin/manticore-executor-dev /usr/bin/php && \
curl -sSL https://github.com/manticoresoftware/executor/releases/download/v0.6.9/manticore-executor_${EXECUTOR_VERSION}_linux_${TARGET_ARCH}.tar.gz | tar -xzf - && \
mv manticore-executor_${EXECUTOR_VERSION}_linux_${TARGET_ARCH}/manticore-executor /usr/bin && \
rm -fr manticore-executor_${EXECUTOR_VERSION}_linux_${TARGET_ARCH}
RUN cd /usr/local/share/manticore/modules && \
git clone https://github.com/manticoresoftware/manticoresearch-buddy.git && \
mv manticoresearch-buddy manticore-buddy && \
cd manticore-buddy && \
git checkout $BUDDY_REV && \
git clone https://github.com/manticoresoftware/phar_builder.git && \
./phar_builder/bin/build --name="Manticore Buddy" --package="manticore-buddy" && \
mv ./build/manticore-buddy ./bin/manticore-buddy && \
composer install && \
cd /
# alter bash prompt
ENV PS1A="kit:\w> "
RUN echo 'PS1=$PS1A' >> ~/.bashrc
RUN mkdir -p /var/run/manticore && \
bash -c "mkdir -p /var/{run,log,lib}/manticore-test" && \
mkdir -p /usr/share/manticore/morph/ && \
echo -e 'a\nb\nc\nd\n' > /usr/share/manticore/morph/test
RUN mkdir -p /var/run/mysqld/ && echo -e "common { \n\
plugin_dir = /usr/local/lib/manticore\n\
lemmatizer_base = /usr/share/manticore/morph/\n\
}\n\
searchd {\n\
listen = 9306:mysql41\n\
listen = /var/run/mysqld/mysqld.sock:mysql41\n\
listen = 9312\n\
listen = 9308:http\n\
log = /var/log/manticore/searchd.log\n\
query_log = /var/log/manticore/query.log\n\
pid_file = /var/run/manticore/searchd.pid\n\
data_dir = /var/lib/manticore\n\
query_log_format = sphinxql\n\
# buddy_path = manticore-executor-dev /workdir/src/main.php\n\
}\n" > "/usr/local/etc/manticoresearch/manticore.conf" && \
rm -f /etc/manticore.conf && \
ln -sf /usr/local/etc/manticoresearch/manticore.conf /etc/manticore.conf && \
ln -sf /usr/local/var/lib/manticore/ /var/lib/manticore && \
ln -sf /usr/local/var/log/manticore/ /var/log/manticore
# Prevent the container from exiting
ENTRYPOINT ["tail"]
CMD ["-f", "/dev/null"]
# Building dev version
# docker build -t manticoresearch/manticore-executor-kit:0.6.9 -f Dockerfile .
# Building release version
# docker build --build-arg MANTICORE_REV=manticore-6.0.4 --build-arg COLUMNAR_REV=columnar-2.0.4 -t manticoresearch/manticore-executor-kit:0.6.9-6.0.4 -f Dockerfile .