1 Star 0 Fork 0

hao_zhang/ta-lib-python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
John Benediktsson 提交于 2021-10-25 10:51 . Switch to pytest from nose.
# Dockerfile for TA-Lib. To build:
#
# docker build --rm -t talib .
#
# To run:
#
# docker run --rm -it talib bash
#
ARG PYTHON_VERSION="3.7"
FROM python:$PYTHON_VERSION as builder
ENV TA_PREFIX="/opt/ta-lib-core"
ENV TA_LIBRARY_PATH="$TA_PREFIX/lib" \
TA_INCLUDE_PATH="$TA_PREFIX/include"
WORKDIR /src/ta-lib-core
RUN apt-get update && apt-get install -y \
gfortran \
libfreetype6-dev \
libhdf5-dev \
liblapack-dev \
libopenblas-dev \
libpng-dev \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz \
| tar xvz --strip-components 1 \
&& ./configure --prefix="$TA_PREFIX" \
&& make \
&& make install
WORKDIR /src/ta-lib-python
COPY . .
RUN python -m pip install -e . \
&& python -c 'import numpy, talib; close = numpy.random.random(100); output = talib.SMA(close); print(output)' \
&& python -m pip wheel --wheel-dir wheels .
ARG RUN_TESTS="1"
RUN if [ "$RUN_TESTS" -ne "0" ]; then \
python -m pip install -r requirements_test.txt \
&& pytest . ; \
else \
echo "Skipping tests\n" ; \
fi
# Build final image.
FROM python:$PYTHON_VERSION-slim
COPY --from=builder /src/ta-lib-python/wheels /opt/ta-lib-python/wheels
COPY --from=builder /opt/ta-lib-core /opt/ta-lib-core
RUN python -m pip install --no-cache-dir /opt/ta-lib-python/wheels/*.whl \
&& python -c 'import numpy, talib; close = numpy.random.random(100); output = talib.SMA(close); print(output)'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/hao_zhang/ta-lib-python.git
[email protected]:hao_zhang/ta-lib-python.git
hao_zhang
ta-lib-python
ta-lib-python
master

搜索帮助