-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (42 loc) · 1.17 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
FROM ubuntu:20.04 as base
# Config
ARG BRANCH="master"
ARG CLANG_VERSION=15
# General dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -yq wget gnupg \
&& rm -rf /var/lib/apt/lists/*
# Add llvm repo
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${CLANG_VERSION} main" >> /etc/apt/sources.list
# Run dependencies
RUN apt-get update \
&& apt-get install -yq "clang-${CLANG_VERSION}" \
&& rm -rf /var/lib/apt/lists/*
# Build binder
FROM base as build
# Build dependencies
RUN apt-get update
RUN apt-get install -yq \
"libclang-${CLANG_VERSION}-dev" \
cmake \
git \
build-essential \
zlib1g-dev \
libhts-dev \
libssl-dev
# Clone binder source
ARG REPO="https://github.com/RosettaCommons/binder.git"
RUN git clone --depth 1 --branch "${BRANCH}" "${REPO}" /binder
# Build
WORKDIR "/build"
RUN cmake \
-DCMAKE_CXX_COMPILER="$(which clang++-"${CLANG_VERSION}")" \
-DBINDER_ENABLE_TEST=OFF \
/binder
RUN make "-j$(nproc)"
RUN make install
# Install image
FROM base as install
COPY --from=build /usr/local/bin/binder /usr/local/bin/binder