Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 2195afd

Browse files
committed
fix: runtime deps
1 parent 4da2743 commit 2195afd

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ ENV TENSORFLOW_VERSION=1.13.1 \
1717
TF_NEED_CUDA=0 \
1818
TF_NEED_MPI=0
1919

20-
RUN apk add --no-cache --virtual build-deps cmake build-base linux-headers \
20+
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
21+
openblas libpng libjpeg-turbo hdf5 libstdc++ && \
22+
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
23+
--virtual build-deps cmake build-base linux-headers \
2124
bash wget file openblas-dev freetype-dev libjpeg-turbo-dev \
22-
libpng-dev openjdk8 swig zip patch && \
23-
pip install --no-cache-dir --no-deps "numpy==$NUMPY_VERSION" h5py \
24-
keras_applications==1.0.5 keras_preprocessing==1.0.3 && \
25+
libpng-dev hdf5-dev openjdk8 swig zip patch && \
26+
pip install --no-cache-dir "numpy==$NUMPY_VERSION" h5py && \
27+
pip install --no-cache-dir --no-deps keras_applications==1.0.7 keras_preprocessing==1.0.9 && \
2528
echo 'Downloading and compiling bazel' && \
2629
wget -q "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip" \
2730
-O bazel.zip && \
2831
mkdir "bazel-${BAZEL_VERSION}" && \
2932
unzip -qd "bazel-${BAZEL_VERSION}" bazel.zip && \
3033
rm bazel.zip && \
3134
cd "bazel-${BAZEL_VERSION}" && \
32-
sed -i -e 's/-classpath/-J-Xmx8192m -J-Xms128m -classpath/g' \
35+
sed -i -e 's/-classpath/-J-Xmx6096m -J-Xms128m -classpath/g' \
3336
scripts/bootstrap/compile.sh && \
3437
bash compile.sh && \
3538
cp -p output/bazel /usr/local/bin/ && \
@@ -45,12 +48,13 @@ RUN apk add --no-cache --virtual build-deps cmake build-base linux-headers \
4548
sed -i -e '/define TF_GENERATE_STACKTRACE/d' tensorflow/core/platform/stacktrace_handler.cc && \
4649
bazel build -c opt --local_resources "${LOCAL_RESOURCES}" //tensorflow/tools/pip_package:build_pip_package && \
4750
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg && \
51+
cd / && \
4852
cp /tmp/tensorflow_pkg/*.whl /root && \
4953
pip install --no-cache-dir /root/*.whl && \
50-
python -c 'import tensorflow; print(tensorflow.__version__)' && \
54+
python -c 'import tensorflow as tf; print(tf.__version__)' && \
5155
find /usr/lib /usr/local \
5256
\( -type d -a -name '__pycache__' -o -name '(test|tests)' \) \
53-
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
57+
-o \( -type f -a -name '(*.pyc|*.pxd)' -o -name '(*.pyo|*.pyd)' \) \
5458
-exec rm -rf '{}' + && \
5559
find /usr/lib* /usr/local/lib* -name '*.so' -print \
5660
-exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \

0 commit comments

Comments
 (0)