PoeticalJustice

导航

week08 S8-01 docker images tensorflow-jupyter

rt

官网http://jupyter.org/

安装

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

 

推荐使用docker方式

登录

docker login

 

docker pull qianmao/cs503_tensorflow_jupyter
从docker hub下载images

 

 

我们下载配置好的

 

 

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

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

 

 

 

那么

 

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

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

 

 

 

 

 

 

 

 

 

 

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

 

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

 

 

 

那么

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

 

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

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

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 2 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'

 

下载各种包和依赖

 

sudo docker login

sudo docker push hanshanyang/cs503_tensorflow_jupyter

posted on 2018-09-14 14:18  PoeticalJustice  阅读(335)  评论(0编辑  收藏  举报