Friday, February 15, 2019

HOWTO : Install docker-ce and nvidia-docker2 on Ubuntu 18.04.2 and Kali Linux 2019.1

docker-ce requires nvidia-docker2 on CUDA system.

Install nVidia driver :

On Ubuntu 18.04.2 :
HOWTO : Intel and nVidia GPUs on Ubuntu 18.04.1 LTS

On Kali Linux 2019.1 :
HOWTO : nVidia and HashCat on Kali Linux 2018.4

Uninstall docker.io (if any)

sudo apt remove docker docker-engine docker.io containerd runc docker-compose

Ready for docker-ce

On Ubuntu 18.04.2 :

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt update


On Kali Linux 2019.1 :

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" > /etc/apt/sources.list.d/docker-ce.list

apt update


Ready for nvidia-docker2

On Ubuntu 18.04.2 :

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)

curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt update


On Kali Linux 2019.1 :

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -

curl -s -L https://nvidia.github.io/nvidia-docker/debian9/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list

apt update


Install docker-ce and nvidia-docker2

apt-cache madison docker-ce
apt-cache madison nvidia-docker2


Find the most matched versions and the following settings are for my system at the time of this writing :

On Ubuntu 18.04.2 :

sudo apt install docker-ce=18.03.1-ce-0-debian docker-ce-cli=18.03.1-ce-0-debian containerd.io nvidia-docker2=2.0.3+docker18.03.1-1 nvidia-container-runtime=2.0.3+docker18.03.1-1

On Kali Linux 2019.1 :

apt install docker-ce=18.03.1-ce-0-debian docker-ce-cli=18.03.1-ce-0-debian containerd.io nvidia-docker2=2.0.3+docker18.03.1-1 nvidia-container-runtime=2.0.3+docker18.03.1-1

If the versions are not matched, the installation will be failed.

Install docker-compose

sudo apt install python3-pip
pip3 install docker-compose pip --ugrade


Configure docker-ce

sudo nano /etc/docker/daemon.json

Add the following in front of "runtimes": { :

"default-runtime": "nvidia",

sudo systemctl enable docker
sudo systemctl start docker


Basic usage

docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi

Remark

Make sure the nvidia driver and CUDA versions in the host computer is equal or greater than the versions in docker containers. Otherwise, docker containers refuse to start.

That's all! See you.


Monday, February 11, 2019

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.

Features

- 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 Docker is an Open Source Project which is released under GPLv3 License and it is developed by Samiux.

Reference

Tensorflow Docker for Deep Learning Programming

That's all! See you.


Friday, February 01, 2019

Kali Linux Lite Docker For Lightweight Pentesting

Offensive Security builds a Kali Linux base Docker image which do not have any tool on it. Meanwhile, there is no graphic interface (Display Manager) too.

Kali Linux Lite Docker is a bundle of scripts to generate Docker image for lightweight pentesting purpose. Not all the tools available in Kali Linux are on the generated image. If so, it takes more that 20GB spaces and it breaks the policy of the Docker - microservices. The image is trying to keep it as small as possible. The Kali Linux Lite Docker image can be ran on Linux, Windows and MacOSX without any problem. The scripts are released under GPLv3 by Samiux.

The script will generate an image of around 4-5GB in size. This image include the following command line (text mode) tools :

(A) Scanners
- nmap, wpscan, dirb, masscan, unicornscan, netdiscover

(B) Exploitation
- metasploit-framework exploitdb sqlmap

(C) Debuggers and Compilers
- gdb gdb-doc, gdb-peda, build-essential

(D) Webshells and network tools
- net-tools, webshells, weevely

(E) CTF related
- steghide xxd


Source

Kali Linux Lite Docker For Lightweight Pentesting