|
| 1 | +ARG UBUNTU_VERSION=22.04 |
| 2 | + |
| 3 | +FROM ubuntu:${UBUNTU_VERSION} AS base |
| 4 | + |
| 5 | +ENV PATH /root/bin:$PATH |
| 6 | + |
| 7 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 8 | + build-essential \ |
| 9 | + libcurl3-dev \ |
| 10 | + libfreetype6-dev \ |
| 11 | + libhdf5-serial-dev \ |
| 12 | + libzmq3-dev \ |
| 13 | + pkg-config \ |
| 14 | + rsync \ |
| 15 | + software-properties-common \ |
| 16 | + sudo \ |
| 17 | + zlib1g \ |
| 18 | + unzip \ |
| 19 | + zip \ |
| 20 | + zlib1g-dev \ |
| 21 | + wget \ |
| 22 | + git \ |
| 23 | + openjdk-8-jre-headless \ |
| 24 | + autoconf \ |
| 25 | + automake \ |
| 26 | + libtool \ |
| 27 | + libffi-dev \ |
| 28 | + && apt-get clean \ |
| 29 | + && rm -rf /var/lib/apt/lists/* |
| 30 | + |
| 31 | +#install python |
| 32 | +WORKDIR /home/workdir |
| 33 | +RUN wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz \ |
| 34 | + && tar -xzvf Python-3.8.6.tgz \ |
| 35 | + && cd Python-3.8.6 \ |
| 36 | + && ./configure --prefix=/usr/local/python3 --enable-optimizations \ |
| 37 | + && make -j96 \ |
| 38 | + && make install |
| 39 | +RUN rm -f /usr/bin/python \ |
| 40 | + && rm -f /usr/bin/pip \ |
| 41 | + && ln -s /usr/local/python3/bin/python3.8 /usr/bin/python \ |
| 42 | + && ln -s /usr/local/python3/bin/pip3 /usr/bin/pip \ |
| 43 | + && rm -rf /home/workdir |
| 44 | + |
| 45 | +RUN python -m pip --no-cache-dir install --upgrade \ |
| 46 | + "pip<20.3" \ |
| 47 | + setuptools==52.0.0 |
| 48 | + |
| 49 | +RUN pip install wheel==0.37.1 |
| 50 | + |
| 51 | +RUN pip install astor==0.8.1 |
| 52 | +RUN pip install numpy==1.16.6 |
| 53 | +RUN pip install protobuf==3.17.3 |
| 54 | +RUN pip install --no-deps keras-preprocessing==1.0.5 |
| 55 | + |
| 56 | +# install bazel |
| 57 | +WORKDIR /home/workdir |
| 58 | + |
| 59 | +ARG BAZEL_VERSION=0.26.1 |
| 60 | + |
| 61 | +RUN wget -O /home/workdir/installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh \ |
| 62 | + && wget -O /home/workdir/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" \ |
| 63 | + && chmod +x /home/workdir/installer.sh \ |
| 64 | + && /home/workdir/installer.sh \ |
| 65 | + && rm -rf /home/workdir |
0 commit comments