week08 S8-01 docker images tensorflow-jupyter

rt

官网http://jupyter.org/

week08 S8-01 docker images tensorflow-jupyter

安装

一种是 npm install的方式 这种需要自己配置 python和那个tansflow很麻烦

week08 S8-01 docker images tensorflow-jupyter

推荐使用docker方式

登录

docker login
docker pull qianmao/cs503_tensorflow_jupyter

从docker hub下载images

week08 S8-01 docker images tensorflow-jupyter

我们下载配置好的

week08 S8-01 docker images tensorflow-jupyter

运行这个image 从内部的8888端口到外部的8888端口

docker run -it --rm -p : qianmao/cs503_tensorflow_jupyter

week08 S8-01 docker images tensorflow-jupyter

week08 S8-01 docker images tensorflow-jupyter

那么week08 S8-01 docker images tensorflow-jupyter

如果你在本地运行那么以上已经完成

或许你以后还要用 所以你要将他上传到你的dockerhub里 那么你需要将本地的images改成你的yourname/cs503_tensorflow_jupyter

如果你要自己配置自己的docker images通过Dockerfile的方式

FROM jupyter/scipy-notebook
MAINTAINER Jupyter Project <jupyter@googlegroups.com>
#Insatall Python Tensorflow
RUN conda install --quiet --yes -n python2 'tensorflow=1.0.1'

Dockerfile

week08 S8-01 docker images tensorflow-jupyter

那么

sudo docker build . -t your_name/cs503_transorflow_juyter

sudo docker login

sudo docker push your_name/cs503_transorflow_juyter

我们下面来做

在本地创建自己的image

sudo docker build . -t hanshanyang/cs503_tensorflow_jupyter

week08 S8-01 docker images tensorflow-jupyter

week08 S8-01 docker images tensorflow-jupyter

乳沟中途出现问题 在执行一次就好

week08 S8-01 docker images tensorflow-jupyter

结果出现问题 说缺乏运行环境  那么就配置环境被 谷歌

https://www.andrey-melentyev.com/python-environments-and-where-to-find-them.html#docker

根据这个帖子

添加一下Dockerfile

FROM nvidia/cuda:9.0-cudnn7-devel
FROM jupyter/scipy-notebook
USER root
MAINTAINER Jupyter Project <jupyter@googlegroups.com>
#Insatall Python Tensorflow
# Setup build environment
RUN apt-get update --fix-missing && \
apt-get install -y build-essential cmake wget ca-certificates git # Install Miniconda
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh ENV PATH /opt/conda/bin:$PATH # Install Python packages
RUN conda install -y tensorflow-gpu keras-gpu ipython # A nicer Python REPL
ENTRYPOINT ["ipython"] RUN conda install --quiet --yes -n python2 'tensorflow=1.0.1'

下载各种包和依赖

week08 S8-01 docker images tensorflow-jupyter

sudo docker login

sudo docker push hanshanyang/cs503_tensorflow_jupyter
上一篇:C趣味100道之58.拉丁方的一些想法。


下一篇:C语言栈的实现