Reputation: 600
I have been trying to do this for a while now. I wasn't able to get a build on my local machine so I went the Docker route. I was able to successfully the use docker image devel-gpu to build Tensorflow. The problem is that it built the latest and greatest (2.5). I have searched and searched for a way to build an older 2.x version but have had no luck.
How do you build, say TensorFlow 2.1 using docker?
I seemed like they quit making docker images for individual versions that contained the source code to build.
Upvotes: 2
Views: 263
Reputation: 20286
If you are fine with using already built images there are older versions available on Docker Hub. Here is a link for 2.1: https://hub.docker.com/r/tensorflow/tensorflow/tags?page=1&name=2.1 This is the easiest way to obtain an older version.
If you want to build it yourself:
git clone https://github.com/tensorflow/tensorflow.git && cd tensorflow
git checkout v2.1.0
tensorflow/tools/dockerfiles/dockerfiles/
but before building I recommend you to check out tensorflow/tools/dockerfiles/README.md
for exact building instructions. For version 2.1.0 it states that you have to run build command setting context to the directory with the README.md
. That is:cd tensorflow/tools/dockerfiles
docker build -f ./dockerfiles/cpu.Dockerfile -t tf .
And that's pretty much it, when building is finished you'll have an image named tf:latest
(customize with flag -t
in build command).
Upvotes: 0