-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-rocksdb-rust
86 lines (68 loc) · 1.93 KB
/
Dockerfile-rocksdb-rust
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
FROM debian:jessie
LABEL maintainer="mtso <[email protected]>"
# Used once to build the base build image for the first build stage
# where rocksdb is compiled-in.
WORKDIR /root
# Install rocksdb dependencies
ARG ROCKSDB_REPO='https://github.com/facebook/rocksdb.git'
ARG ROCKSDB_VERSION='5.14.2'
ARG ROCKSDB_TAG="v${ROCKSDB_VERSION}"
RUN set -x\
&& apt-get update && apt-get install -y\
build-essential\
git\
libbz2-dev\
libgflags-dev\
libjemalloc-dev\
libsnappy-dev\
libtbb-dev\
zlib1g-dev
# Install rocksdb
RUN git clone $ROCKSDB_REPO /tmp/rocksdb\
&& cd /tmp/rocksdb\
&& git checkout tags/${ROCKSDB_TAG}\
&& make -j$(nproc) shared_lib\
&& make install-shared\
&& strip /usr/local/lib/librocksdb.so.${ROCKSDB_VERSION}\
&& rm -rf /tmp/rocksdb
# Rust installation dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
ssh \
libssl-dev \
pkg-config && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install cmake
ARG CMAKE_VERSION=3.12
RUN mkdir -p /tmp/cmake && cd /tmp/cmake && \
curl -O https://cmake.org/files/v$CMAKE_VERSION/cmake-$CMAKE_VERSION.0.tar.gz && \
tar -xzvf cmake-$CMAKE_VERSION.0.tar.gz && \
cd cmake-$CMAKE_VERSION.0 && \
./bootstrap && \
make -j4 && \
make install \
&& rm -rf /tmp/cmake
# Install rust
ENV RUSTUP_HOME=/rust
ENV CARGO_HOME=/cargo
ENV PATH=/cargo/bin:/rust/bin:$PATH
RUN echo "(curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --no-modify-path) && rustup default nightly" > /install-rust.sh && chmod 755 /install-rust.sh
# Clean build libraries
RUN apt-get purge -y\
build-essential\
git\
libbz2-dev\
libgflags-dev\
libjemalloc-dev\
libsnappy-dev\
libtbb-dev\
zlib1g-dev
RUN apt-get install -y\
libbz2-1.0\
libjemalloc1\
libtbb2\
zlib1g