一.安装docker客户端
1.按官方文档安装docker客户端,启动服务。
https://docs.docker.com/engine/installation/linux/centos/
增加用户至docker组,在使用docker 命令时不需要sudo
sudo gpasswd -a${USER}docker
2.在docker环境中安装ubuntu 14.04
(1). 下载ubuntu镜像: docker pull ubuntu:14.04
(2).进入镜像ubuntu:14.04定制相关环境
docker run -it ubuntu:14.04 /bin/bash
进入ubuntu镜像环境后,更新相关包
apt-get update
apt-get upgrade
apt-get install wget
apt-get install make
apt-get install gcc
(3).ubuntu自带VI编辑器不好用的解决
apt-get remove vim-common
apt-get install vim
(4).安装git,配置能访问GitHub.com
apt-get install git-core
git ssh key 生成
ssh-keygen -t rsa -C "hongkong@aliyun_robust.com"
把~/.ssh/id_rsa.pub 放到GitHub.com网站
(5).定制好的ubuntu镜像本地提交版本
docker commit 144e54f224fa ubuntu14.04/robust20161109
(6)源码安装python 2.7
下载:wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
./configue
make &&make install
编辑.bash_profile 把 python2.7设置进去
(7).下载安装java8
(8).开始安装https://github.com/tensorflow/tensorflow
apt-get install python-pip python-dev
exportTF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc2-cp27-none-linux_x86_64.whl
sudo pip install --upgrade$TF_BINARY_URL
(8).搭建docker 仓库服务器
docker pull registry
docker run -d -p 5000:5000 -v ~/dockerimages/data/registry:/var/lib/registry registry
修改tag 设置上传地址
docker tag busybox 127.0.0.1:5000/busybox
配置tls访问
https://github.com/docker/docker.github.io/blob/master/registry/deploying.md
生成证书
openssl req -newkey rsa:2048 -nodes -sha256 -keyout certs/domain.key -x509 -days 365 -out certs/domain.crt
生成证书时注意填写的mydockerhub.com 是需要和客户端的domain.crt 放置目录名一样
docker run -d -p 5000:5000 --name registry -v ~/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key registry
mkdir -p /etc/docker/certs.d/mydockerhub.com:5000
cp ~/certs/domain.crt /etc/docker/certs.d/mydockerhub.com:5000/ca.crt
service docker restart //安装证书后,重启Docker Daemon
docker pull mydockerhub.com:5000/tensorflow_0.11
成功下载
=====问题===
无法安装 scipy 时:
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
无法安装 Pillow
apt-get install libjpeg8-dev