Skip to content

Commit 1456108

Browse files
authored
Explain how to download tf binaries from PyPI (#41)
1 parent 39fb741 commit 1456108

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.rst

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,32 @@ Dockerfile.
118118
#. Copy your Python package to “final” Dockerfile directory that you are building.
119119
cp dist/sagemaker_tensorflow_container-<package_version>.tar.gz docker/<tensorflow_version>/final/py2
120120

121-
If you want to build "final" Docker images, then use:
121+
If you want to build "final" Docker images, for versions 1.6 and above, you will first need to download the appropriate tensorflow pip wheel, then pass in its location as a build argument. These can be obtained from pypi. For example, the files for 1.6.0 are here:
122+
123+
https://pypi.org/project/tensorflow/1.6.0/#files
124+
https://pypi.org/project/tensorflow-gpu/1.6.0/#files
125+
126+
Note that you need to use the tensorflow-gpu wheel when building the GPU image.
127+
128+
Then run:
129+
130+
::
131+
132+
# All build instructions assumes you're building from the same directory as the Dockerfile.
133+
134+
# CPU
135+
docker build -t <image_name>:<tag> --build-arg py_version=<py_version> --build-arg framework_installable=<path to tensorflow binary> -f Dockerfile.cpu .
136+
137+
# GPU
138+
docker build -t <image_name>:<tag> --build-arg py_version=<py_version> --build-arg framework_installable=<path to tensorflow binary> -f Dockerfile.gpu .
139+
140+
::
141+
142+
# Example
143+
docker build -t preprod-tensorflow:1.6.0-cpu-py2 --build-arg py_version=2
144+
--build-arg framework_installable=tensorflow-1.6.0-cp27-cp27mu-manylinux1_x86_64.whl -f Dockerfile.cpu .
145+
146+
The dockerfiles for 1.4 and 1.5 build from source instead, so when building those, you don't need to download the wheel beforehand:
122147

123148
::
124149

@@ -140,9 +165,6 @@ If you want to build "final" Docker images, then use:
140165
# GPU
141166
docker build -t preprod-tensorflow:1.4.1-gpu-py2 -f Dockerfile.gpu .
142167

143-
# For building images of TensorFlow versions 1.6 and above
144-
docker build -t preprod-tensorflow:1.6.0-cpu-py2 --build-arg py_version=2
145-
--build-arg framework_installable=tensorflow-1.6.0-cp27-cp27mu-manylinux1_x86_64.whl -f Dockerfile.cpu .
146168

147169
Running the tests
148170
-----------------

0 commit comments

Comments
 (0)