docker file
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
MAINTAINER yaotc "yaotiechui@gmail.com"
RUN apt-get update --fix-missing && apt-get install -y curl wget vim net-tools bzip2 git\
&& rm -rf /var/lib/apt/lists/* && mkdir -p /software
WORKDIR /software
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-4.2.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /software/conda && \
rm ~/anaconda.sh && \
# ln -s /software/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo "export PATH=/software/conda/bin:$PATH" >> ~/.bashrc
# && \
# echo "conda activate base" >> ~/.bashrc
# RUN /software/conda/bin/conda create -n python3.5 python=3.5 pytorch torchvision -c pytorch\
# && apt clean \
# && apt autoremove -y
RUN /software/conda/bin/pip install PyHamcrest \
&& /software/conda/bin/pip install --upgrade pip \
&& /software/conda/bin/pip install msgpack \
&& /software/conda/bin/pip3 install torch torchvision \
# && /software/conda/bin/conda install pytorch torchvision -c pytorch \
&& /software/conda/bin/pip install opencv-python \
&& apt clean \
&& apt autoremove -y
CMD [ "/bin/bash" ]
# build:
docker build -t yaotc/pytorch .
# change tag:
docker tag yaotc/pytorch:latest yaotc/pytorch:0.4.1
# run for test:
docker run -t -i yaotc/pytorch:0.4.1
# push to docker hub:
docker push yaotc/pytorch:0.4.1