nstall from a package
If you cannot use Docker’s repository to install Docker CE, you can download the .deb file for your release and install it manually. You will need to download a new file each time you want to upgrade Docker CE.
Go to https://download.docker.com/linux/ubuntu/dists/, choose your Ubuntu version, browse to pool/stable/ and choose amd64,armhf, or s390x. Download the .deb file for the Docker version you want to install.
Note: To install an edge package, change the word stable in the URL to edge. Learn about stable and edge channels.
Install Docker CE, changing the path below to the path where you downloaded the Docker package.
$ sudo dpkg -i /path/to/package.deb
The Docker daemon starts automatically.
Verify that Docker CE is installed correctly by running the hello-world image.
$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Docker CE is installed and running. You need to use sudo to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.
2. https://github.com/widuu/chinese_docker/blob/master/installation/ubuntu.md#Ubuntu%E5%AE%89%E8%A3%85Docker
##Ubuntu Docker可选配置
这部分主要介绍了 Docker 的可选配置项,使用这些配置能够让 Docker 在 Ubuntu 上更好的工作。
You need at least a 384.xx series driver for CUDA 9. NVIDIA recommends 384.81 or later. If you're installing from deb packages, note that the package name is different for nvidia-384 versus nvidia-375 in order that the major driver version upgrade is intentional rather than automatic.
Alternatively, you can also use a CUDA 8.0 image and not upgrade your driver:
nvidia-docker run --rm nvidia/cuda:8.0-devel nvidia-smi 3. Install Docker and nvidia-docker
# Install docker
curl -sSL https://get.docker.com/ | sh
The docker container needs access to the GPU devices. For this purpose use `nvidia-docker` which is a wrapper around the standard `docker` command.
# Install nvidia-docker and nvidia-docker-plugin
wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-rc.3/nvidia-docker_1.0.0.rc.3-1_amd64.deb
sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
# Test nvidia-smi.
nvidia-docker run --rm nvidia/cuda nvidia-smi You might need to use `nvidia-docker` with sudo! 安装Tensorflow http://blog.csdn.net/cq361106306/article/details/54094517
http://blog.csdn.net/freewebsys/article/details/70237003
http://blog.csdn.net/dream_an/article/details/55520205
The container itself is started as pointed out in the official documentation as follows:
# Run container
nvidia-docker run -d --name <some name> -p 8888:8888 -p 6006:6006 gcr.io/tensorflow/tensorflow:latest-gpu
# Log in
nvidia-docker exec -it <some name> bash
e.g.:
nvidia-docker run -d --name tf1 -p 8888:8888 -p 6006:6006 gcr.io/tensorflow/tensorflow:latest-gpu
nvidia-docker exec -it tf1 bash
Note: Port 8888 is for ipython notebooks and port 6006 is for TensorBoard.
You can test if everything is alright by running this Python script. https://www.tensorflow.org/install/install_linux#InstallingDocker
GPU support
Prior to installing TensorFlow with GPU support, ensure that your system meets all NVIDIA software requirements. To launch a Docker container with NVidia GPU support, enter a command of the following format:
$ nvidia-docker run -it-p hostPort:containerPort TensorFlowGPUImage
where:
-p hostPort:containerPort is optional. If you plan to run TensorFlow programs from the shell, omit this option. If you plan to run TensorFlow programs as Jupyter notebooks, set both hostPort and containerPort to 8888.
TensorFlowGPUImage specifies the Docker container. You must specify one of the following values:
gcr.io/tensorflow/tensorflow:latest-gpu, which is the latest TensorFlow GPU binary image.
gcr.io/tensorflow/tensorflow:latest-devel-gpu, which is the latest TensorFlow GPU Binary image plus source code.
gcr.io/tensorflow/tensorflow:version-gpu, which is the specified version (for example, 0.12.1) of the TensorFlow GPU binary image.
gcr.io/tensorflow/tensorflow:version-devel-gpu, which is the specified version (for example, 0.12.1) of the TensorFlow GPU binary image plus source code.
We recommend installing one of the latest versions. For example, the following command launches the latest TensorFlow GPU binary image in a Docker container from which you can run TensorFlow programs in a shell:
$ nvidia-docker run -it gcr.io/tensorflow/tensorflow:latest-gpu bash
The following command also launches the latest TensorFlow GPU binary image in a Docker container. In this Docker container, you can run TensorFlow programs in a Jupyter notebook:
$ nvidia-docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-gpu
The following command installs an older TensorFlow version (0.12.1):
$ nvidia-docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow:0.12.1-gpu
Docker will download the TensorFlow binary image the first time you launch it. For more details see the TensorFlow docker readme.
Next Steps
You should now validate your installation. 使用:Docker
http://songhuiming.github.io/pages/2017/02/25/an-zhuang-dockerhe-tensorflow/
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
5.4. 退出
exit
To restart the exited container:
docker start -a -i `docker ps -q -l`
docker start start a container (requires name or ID)
-a attach to container
-i interactive mode
docker ps List containers
-q list only container IDs
-l list only last created container
5.5. How do I install new libraries in Docker?
Therre are two ways to do this:
First methodd: Modify the Dockerfile directly to install new or update your existing libraries. You will need to do a docker build after you do this. If you just want to update to a newer version of the DL framework(s), you can pass them as CLI parameter using the --build-arg tag (see for details). The framework versions are defined at the top of the Dockerfile. For example, docker build -t shmhub/dl-docker:cpu -f Dockerfile.cpu --build-arg TENSORFLOW_VERSION=1.2.0 .
Second mthodd: you can install or upgrade in the container. After it is done, exit the cocntainer and do a commit as introducte below.
5.5. 向docker image提交container change
docker commit -m "install vim wget on ubuntu" -a "author: shm" 7de2c97f7a85 shm/ubuntu_custom
shm@ubuntu:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tensorflow/tensorflow latest ea40dcc45724 2 weeks ago 1.03 GB
ubuntu latest f49eec89601e 5 weeks ago 129 MB
shm@ubuntu:~$ docker commit -m "install vim wget on ubuntu" -a "author: shm" 7de2c97f7a85 shm/ubuntu_custom
sha256:5ed742f690e11c65db83936847c7c5659c5834f6b2c93b52d110455936e6a224
shm@ubuntu:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
shm/ubuntu_custom latest 5ed742f690e1 12 seconds ago 647 MB
tensorflow/tensorflow latest ea40dcc45724 2 weeks ago 1.03 GB
ubuntu latest f49eec89601e 5 weeks ago 129 MB
5.6. 向仓库提交镜像
首先登陆
docker login -u docker-username
然后push
5.6.1. list the image and get the tag id
shm@shm-xps9550:~/projects/dl_lessons/courses-master/deeplearning1/nbs$ `docker images`
REPOSITORY TAG IMAGE ID CREATED SIZE
shmhub/dl-docker cpu 0f1e40d1bed8 12 days ago 9.13 GB
ubuntu 16.04 6a2f32de169d 13 days ago 117 MB
http://blog.csdn.net/tina_ttl/article/details/51417358
http://[all ip addresses on your system]:8888/==========================>http://172.17.0.2:8888/
=========================================================================================================================================================================================================2017/11/8更=====
docker pull tensorflow/tensorflow:nightly-gpu-py3
======================================docker run bash版本========================================