-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
31 lines (19 loc) · 1.3 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
ARG UBUNTU_VERSION=20.04
FROM ubuntu:${UBUNTU_VERSION} AS build
LABEL maintainer "luka.cehovin@protonmail.com"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential cmake make git pkg-config g++ software-properties-common python3-dev python3-numpy-dev python3-setuptools && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
RUN git clone https://github.com/pybind/pybind11.git && cd pybind11 && mkdir build && cd build && cmake -DPYBIND11_TEST=OFF -DPYBIND11_INSTALL=ON .. && make -j install
COPY . /tmp/echolib/
RUN cd /tmp/echolib && mkdir build && cd build && \
cmake -DBUILD_APPS=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install .. && make -j && make install
RUN export PYTHON_INSTALL=`python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(prefix='/tmp/install/'))"` && \
mkdir -p ${PYTHON_INSTALL}/../dist-packages/echolib && cd /tmp/echolib/build/python/ && cp -R echolib ${PYTHON_INSTALL}/../dist-packages/
FROM ubuntu:${UBUNTU_VERSION}
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip python3-numpy python-is-python3 python3-future python3-pyparsing python3-jinja2 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=build /tmp/install /usr/local/