1+ #FROM tensorflow/tensorflow:1.12.0
2+ FROM my_tensorflow_base:1.12.0-py2
3+
4+ COPY docker/sources_18.04.list /etc/apt/sources.list
5+
6+ # necessary for later commands to take effect
7+ RUN md5sum /etc/apt/sources.list \
8+ && apt-get update \
9+ && apt-get install apt-utils inetutils-ping wget curl telnet vim strace libpq-dev curl libsasl2-dev gcc g++ unzip openjdk-8-jdk -y \
10+ && apt-get install build-essential cython -y \
11+ && pip install cython \
12+ && pip install setuptools_scm
13+ # 检查 Cython 是否安装成功
14+ RUN python -c "import Cython"
15+ RUN pip --version
16+
17+ RUN mkdir /EasyRec
18+ COPY requirements /EasyRec/requirements
19+ COPY requirements.txt /EasyRec/
20+ COPY easy_rec /EasyRec/easy_rec/
21+ COPY setup.cfg /EasyRec/
22+ COPY setup.py /EasyRec/
23+ COPY MANIFEST.in /EasyRec/
24+ COPY README.md /EasyRec/
25+ COPY scripts /EasyRec/scripts
26+
27+ RUN curl "http://easyrec.oss-cn-beijing.aliyuncs.com/tools/odpscmd_public_0.45.0.zip" -o /EasyRec/odpscmd_public.zip
28+ RUN mkdir /usr/local/odps_clt/ && cd /usr/local/odps_clt/ && unzip /EasyRec/odpscmd_public.zip
29+ RUN ln -s /usr/local/odps_clt/bin/odpscmd /usr/local/bin/odpscmd
30+
31+ RUN pip install pystack-debugger idna kafka-python -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
32+ # 升级pip
33+ RUN pip install --upgrade pip setuptools wheel
34+
35+ # 安装 setuptools-rust 和 rustc
36+ RUN pip install setuptools-rust
37+ RUN pip install tensorflow_probability==0.5.0
38+ RUN apt-get update && apt-get install -y rustc
39+ RUN apt-get update && \
40+ apt-get install -y rustc && \
41+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
42+ . $HOME/.cargo/env
43+ # 安装 cryptography
44+ RUN pip install cryptography
45+ # 安装基础工具链与依赖项
46+ RUN apt-get update && \
47+ apt-get install -y build-essential libssl-dev libffi-dev python-dev && \
48+ apt-get install -y rustc cargo cmake curl
49+
50+ # 设置国内的 Rust 镜像源
51+ RUN echo '[source.crates-io]\n' > $HOME/.cargo/config
52+ RUN echo 'replace-with = "ustc"' >> $HOME/.cargo/config
53+ RUN echo '[source.ustc]\n' >> $HOME/.cargo/config
54+ RUN echo 'registry = "https://mirrors.ustc.edu.cn/crates.io-index"' >> $HOME/.cargo/config
55+
56+ # 确保 curl 支持 HTTP2
57+ RUN curl -V
58+
59+ # 显示安装好的工具链版本,确保已正确安装
60+ RUN rustc --version
61+ RUN cargo --version
62+ RUN cmake --version
63+
64+ RUN pip install -r /EasyRec/requirements/runtime.txt -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
65+ RUN pip install -r /EasyRec/requirements/extra.txt -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
66+
67+ RUN pip install --user -U https://tfsmoke1.oss-cn-zhangjiakou.aliyuncs.com/tunnel_paiio/common_io/py2/common_io-0.1.0-cp27-cp27mu-linux_x86_64.whl
68+ RUN pip install graphlearn
69+
70+ RUN cd /EasyRec && python setup.py install
71+ RUN rm -rf /EasyRec
72+ RUN python -c "import easy_rec; import pyhive; import datahub; import kafka"
73+
74+ COPY docker/hadoop_env.sh /opt/hadoop_env.sh
0 commit comments