Skip to content

Commit 2f5f1e2

Browse files
committed
install pip whl in final arm image
1 parent 09ccb01 commit 2f5f1e2

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

docker/Dockerfile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,30 @@ RUN dpkg-deb --build --root-owner-group libtensorflow-cc_${TF_VERSION}${GPU_POST
152152
rm -rf libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}/
153153

154154
# copy pip package, if built
155-
ARG BUILD_PIP_PACKAGE=0
155+
ARG BUILD_PIP_PACKAGE
156156
COPY --from=build /tmp/tensorflow/pip/tensorflow*.whl /
157157

158158
# --- final stage with TensorFlow Python and C++ Library -----------------------
159159
FROM --platform=amd64 tensorflow/tensorflow:${TF_VERSION}${GPU_POSTFIX} as final-amd64
160-
ARG TARGETARCH
161160

162-
# FROM ubuntu
163-
FROM --platform=arm64 ubuntu:focal as final-arm64
164-
ARG TARGETARCH
161+
FROM --platform=arm64 ubuntu:focal as final-base-arm64
165162

166-
FROM --platform=arm64 nvcr.io/nvidia/l4t-tensorflow:r35.1.0-tf2.9-py3 as final-arm64-gpu
167-
ARG TARGETARCH
163+
FROM --platform=arm64 rwthika/cuda:11.8-cudnn-trt-ubuntu20.04 as final-base-arm64-gpu
164+
165+
FROM "final-base-arm64${GPU_POSTFIX}" as final-arm64
166+
167+
# copy and install pip package, if built (not present in base image)
168+
ARG BUILD_PIP_PACKAGE
169+
COPY --from=deb-package /tensorflow*.whl /
170+
RUN if [ "${BUILD_PIP_PACKAGE}" = "1" ]; then \
171+
apt-get update && \
172+
apt-get install -y python3-pip && \
173+
python3 -m pip install --no-cache /tensorflow*.whl && \
174+
rm -rf /var/lib/apt/lists/*; \
175+
fi && \
176+
rm -rf /tensorflow*.whl
168177

169-
FROM "final-${TARGETARCH}${GPU_POSTFIX}" as final
178+
FROM "final-${TARGETARCH}" as final
170179

171180
ARG DEBIAN_FRONTEND=noninteractive
172181
ARG TF_VERSION

0 commit comments

Comments
 (0)