|
1 | | -FROM golang:1.16-alpine |
| 1 | +# This file defines the container image used to build and test tm-db in CI. |
| 2 | +# The CI workflows use the latest tag of tendermintdev/docker-tm-db-testing |
| 3 | +# built from these settings. |
| 4 | +# |
| 5 | +# The jobs defined in the Build & Push workflow will build and update the image |
| 6 | +# when changes to this file are merged. If you have other changes that require |
| 7 | +# updates here, merge the changes here first and let the image get updated (or |
| 8 | +# push a new version manually) before PRs that depend on them. |
| 9 | + |
| 10 | +FROM golang:1.17-bullseye AS build |
2 | 11 |
|
3 | 12 | ENV LD_LIBRARY_PATH=/usr/local/lib |
4 | 13 |
|
5 | | -RUN apk add bash build-base bzip2-dev gflags-dev linux-headers \ |
6 | | - perl snappy-dev util-linux wget zlib-dev zstd-dev |
| 14 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 15 | + libbz2-dev libgflags-dev libsnappy-dev libzstd-dev zlib1g-dev \ |
| 16 | + make tar wget |
| 17 | + |
| 18 | +FROM build AS install |
| 19 | +ARG LEVELDB=1.20 |
| 20 | +ARG ROCKSDB=6.24.2 |
7 | 21 |
|
8 | 22 | # Install cleveldb |
9 | 23 | RUN \ |
10 | | - wget -q https://github.com/google/leveldb/archive/v1.20.tar.gz \ |
11 | | - && tar xvf v1.20.tar.gz \ |
12 | | - && cd leveldb-1.20 \ |
| 24 | + wget -q https://github.com/google/leveldb/archive/v${LEVELDB}.tar.gz \ |
| 25 | + && tar xvf v${LEVELDB}.tar.gz \ |
| 26 | + && cd leveldb-${LEVELDB} \ |
13 | 27 | && make \ |
14 | 28 | && cp -a out-static/lib* out-shared/lib* /usr/local/lib \ |
15 | 29 | && cd include \ |
16 | 30 | && cp -a leveldb /usr/local/include \ |
17 | | - && ldconfig $LD_LIBRARY_PATH \ |
| 31 | + && ldconfig \ |
18 | 32 | && cd ../.. \ |
19 | | - && rm -rf v1.20.tar.gz leveldb-1.20 |
| 33 | + && rm -rf v${LEVELDB}.tar.gz leveldb-${LEVELDB} |
20 | 34 |
|
21 | 35 | # Install Rocksdb |
22 | 36 | RUN \ |
23 | | - wget -q https://github.com/facebook/rocksdb/archive/v6.6.4.tar.gz \ |
24 | | - && tar -zxf v6.6.4.tar.gz \ |
25 | | - && cd rocksdb-6.6.4 \ |
26 | | - && sed -i'' 's/install -C/install -c/g' Makefile \ |
| 37 | + wget -q https://github.com/facebook/rocksdb/archive/v${ROCKSDB}.tar.gz \ |
| 38 | + && tar -zxf v${ROCKSDB}.tar.gz \ |
| 39 | + && cd rocksdb-${ROCKSDB} \ |
27 | 40 | && DEBUG_LEVEL=0 make -j4 shared_lib \ |
28 | 41 | && make install-shared \ |
29 | | - && ldconfig $LD_LIBRARY_PATH \ |
| 42 | + && ldconfig \ |
30 | 43 | && cd .. \ |
31 | | - && rm -rf v6.6.4.tar.gz rocksdb-6.6.4 |
| 44 | + && rm -rf v${ROCKSDB}.tar.gz rocksdb-${ROCKSDB} |
0 commit comments