Tensorflow Docker for Deep Learning Programming

Tensorflow is an open source machine learning framework for everyone. The Tensorflow Dockers are built for CPUs support SSE4.2, AVX2 and AVX512 feature which will use the full power of the CPU to train the model.


- Tensorflow 1.12.0
- Ubuntu 18.04.x
- Python 3.6.x
- CPU with SSE4.2 (native docker)
- CPU with AVX2 (default docker)
- CPU with AVX512 (avx512 docker)

- Tensorflow 1.12.0
- Ubuntu 16.04.x
- Python 3.5.x
- CUDA 9.0
- nVidia Driver 384.81

# Example #1, if you have a CPU has up to SSE4.1, no captioned docker is suitable for the CPU.
# Example #2, if you have a CPU has up to AVX2, the AVX512 docker is not suitable for the CPU.
# Example #3, if you have a CPU has up to AVX2, warning message will be given when running "native" docker.

# Example #4, the version of nVidia driver and CUDA should be equal or greater than 384.81 and 9.0 respectively on the host computer.


Tensorflow Docker is an Open Source Project which is released under GPLv3 License and it is developed by Samiux.

A Quick Guide to GPLv3
GNU General Public License Version 3.0


If you like our project, please show your support by sending the donation to Paypal (infosecninjas AT gmail DOT com) in USD or HKD currency. You need a Paypal account for the donation.

Change Log

Version 0.1
Released on Feb 11, 2019 GMT+8
[+] First release

Version 0.2
Released on Feb 14, 2019 GMT+8
[+] Bug fixed

Version 0.3
Released on Feb 15, 2019 GMT+8
[+] Some improvement
[+] Add CUDA docker files

Version 0.4 [Latest, Stable]
Released on Feb 15, 2019 GMT+8
[+] Some improvement


sha256sum f80d352007ca302bad0e779e57c53614fdc0f2516b86b8657b05341d479429f6 tensorflow-cpu-all-0.4.tar.gz

wget https://www.infosec-ninjas.com/files/tensorflow-cpu-all-0.4.tar.gz
tar -xvzf tensorflow-cpu-all-0.4.tar.gz
cd tensorflow-cpu-all

For CPU with AVX2 :

tar -xvzf tensorflow-docker-0.4.tar.gz
cd tensorflow-docker

For CPU with AVX512 :

tar -xvzf tensorflow-docker-avx512-0.4.tar.gz
cd tensorflow-docker-avx512

For CPU with SSE4.2 :

tar -xvzf tensorflow-docker-native-0.4.tar.gz
cd tensorflow-docker-native

For CUDA :

tar -xvzf tensorflow-docker-cuda-0.4.tar.gz
cd tensorflow-docker-cuda

Installation of Docker on Ubuntu

sudo apt update
sudo apt dist-upgrade
sudo apt install docker.io docker-compose

sudo systemctl enable docker

* CUDA docker files require to install "docker-ce", matched version of "nvidia-docker2" and "nvidia-container-runtime" as well as newer version of "docker-compose".

Building Tensorflow Docker

sudo ./build-image.sh

Running Tensorflow Docker


Connect to running container


Copy file to Container

./docker-copy.sh [FILE] [CONTAINER]

Copy file from Container

./docker-copy-from.sh [CONTAINER]:[FILE] [FILE]

Update Docker image

Make sure the Tensorflow docker container is running and updating the packages inside with the following command :


After the update and make sure the container is still running, open another terminal on the host and run the following command :


The image is then up-to-date. Meanwhile, you can store data inside "data" at root directory of the container.

The file stored at "data" directory in the container is stored at "/var/lib/docker/volumes/" on the host.

How to delete host "volumes" on macOSX?

screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

Press "Enter".

cd /var/lib/docker/volumes

To exit, press "CTRL+a+d"

* For macOSX, the "network-mode" should be set to "bridge" in "docker-compose.yml".
* For Linux, the "network-mode" can be either "host" or "bridge" in "docker-compose.yml"

See Also

Docker Documentation
HOWTO : Install docker-ce and nvidia-docker2 on Ubuntu 18.04.2 and Kali Linux 2019.1
CUDA Compatibility of NVIDIA Display / GPU Drivers