Files
Jing ChenandgVisor bot 57a338f87e Optimize all Dockerfiles under images/benchmarks/.
Improve caching, linter compliance, and runtime image sizes.

Notable image size reductions:
- syscallbench: 160MB drop (~250 MB -> ~90 MB) by converting to a multi-stage
  build (AS build) to strip gcc and build tools from the runtime image.
- absl: 80MB drop (665MB -> 486MB) by combining Bazel installer download,
  execution, and cleanup into a single RUN layer.
- build-grpc : 450MB drop (1.38GB -> 830MB) by removing temporary
  bazel-*.sh installer scripts from intermediate layers and adding
  --no-install-recommends.
- tensorflow: 60MB (1.29GB -> 1.23GB) drop by clearing /var/lib/apt/lists/*
  cache.
- util: 56MB (137MB -> 81MB) by clearing apt cache lists.

PiperOrigin-RevId: 958783211
2026-08-03 22:17:54 -07:00

23 lines
1.3 KiB
Docker

FROM tensorflow/tensorflow:1.13.2
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 https://github.com/aymericdamien/TensorFlow-Examples.git
RUN python -m pip install --no-cache-dir -U pip setuptools matplotlib
# Run the Tensorflow examples; they use the CPU only, but what we want here
# is the side-effect of pre-downloading the models they will use.
RUN export PYTHONPATH=$PYTHONPATH:/TensorFlow-Examples/examples; \
cd /TensorFlow-Examples/examples; \
examples=' \
2_BasicModels/kmeans.py \
2_BasicModels/logistic_regression.py \
2_BasicModels/nearest_neighbor.py \
2_BasicModels/random_forest.py \
3_NeuralNetworks/convolutional_network.py \
3_NeuralNetworks/multilayer_perceptron.py \
3_NeuralNetworks/neural_network.py \
'; \
for f in $examples; do python "$f"; done