Skip to content

Commit 35cdb5c

Browse files
Refactor tensorflow in Dockerfile
1 parent 7c63884 commit 35cdb5c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS containerized_aarch64
99
FROM arm32v7/ubuntu:${UBUNTU_VERSION} AS containerized_armv7hf
1010

1111
FROM ${REPO}/acap-native-sdk:${VERSION}-${ARCH}-ubuntu${UBUNTU_VERSION} AS acap-native-sdk
12+
13+
FROM acap-native-sdk AS tensorflow
14+
15+
WORKDIR /opt
16+
17+
# Get TensorFlow and TensorFlow Serving - doing this in parallell saves a little bit of time
18+
RUN <<EOF
19+
git clone -b r2.9 https://github.com/tensorflow/tensorflow.git /opt/tensorflow/tensorflow
20+
git clone -b r2.9 https://github.com/tensorflow/serving.git /opt/tensorflow/serving
21+
EOF
22+
1223
FROM acap-native-sdk AS build
1324

1425
ARG ARCH
@@ -151,11 +162,8 @@ RUN <<EOF
151162
"$SDKTARGETSYSROOT"/usr/include
152163
EOF
153164

154-
# Get TensorFlow and TensorFlow Serving
155-
RUN <<EOF
156-
git clone -b r2.9 https://github.com/tensorflow/tensorflow.git /opt/tensorflow/tensorflow
157-
git clone -b r2.9 https://github.com/tensorflow/serving.git /opt/tensorflow/serving
158-
EOF
165+
# Get TensorFlow and TensorFlow Serving that we've pulled in parallell
166+
COPY --from=tensorflow /opt/tensorflow /opt/tensorflow
159167

160168
## Setup build structure
161169
WORKDIR /opt/app

0 commit comments

Comments
 (0)