nvidia docker照著nvidia的github裝好像會噴錯誤訊息
可以嘗試用這個看看 某部落格
- First, you need to install Docker:
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
- Use docker without sudo:
sudo usermod -aG docker $USER
- Now, have the user logout then login again.
- Second, install tensorflow docker image:
- Follow this README, you also need to install
nvidia-docker
which has details in README too. https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker
- Follow this README, you also need to install
- Create your own container:
- Python3 + GPU:
nvidia-docker run -itd --name <name> -p <port>:8888 tensorflow/tensorflow:nightly-gpu-py3 /run_jupyter.sh --allow-root --ip=0.0.0.0
- Python2 + GPU:
nvidia-docker run -itd --name <name> -p <port>:8888 tensorflow/tensorflow:nightly-gpu /run_jupyter.sh --allow-root --ip=0.0.0.0
- Python3 + GPU:
FROM ubuntu:14.04
MAINTAINER davidtnfsh
RUN sudo apt-get update && \
sudo apt-get install -y openssh-server \
openjdk-7-jdk \
wget \
vim \
# SSH�K�˙C����֧Ԯ
RUN sudo locale-gen zh_TW zh_TW.UTF-8
RUN echo "LC_CTYPE=zh_TW.UTF-8" | sudo tee -a /etc/environment
CMD ["sh","-c" ,"/etc/init.d/ssh start; bash"]
#!/bin/bash
read -p "Create UserNmae : " USER_NAME
read -p "Setting Password [ default : udiclab@720 ] : " USER_PWD
if [ ${#USER_PWD} == 0 ] ; then
USER_PWD="udiclab@720"
fi
read -p "Setting SSH's Port : " USER_PORT
if [ ${#USER_NAME} == 0 -o ${#USER_PORT} == 0 ] ; then
echo "Please at least enter the user name and the port number"
exit 0
fi
echo -e "\nYou Setting:"
echo "User: ${USER_NAME}"
echo "Password: ${USER_PWD}"
echo "Port: ${USER_PORT}"
sudo docker run -itd \
-p $USER_PORT:22 \
--name $USER_NAME \
--hostname $USER_NAME \
udic/ubuntu:1.0 &> /dev/null
# sudo docker exec -ti $USER_NAME sudo sh -c "sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y openssh-server"
sudo docker exec -ti $USER_NAME sudo sh -c "sudo useradd -m $USER_NAME -s /bin/bash;echo \"${USER_NAME}:${USER_PWD}\" | chpasswd;sudo adduser $USER_NAME sudo" &> /dev/null
# sudo docker exec -ti $USER_NAME sudo sh -c "sudo /etc/init.d/ssh start"
# 終端機中文支援
# sudo docker exec -ti $USER_NAME sudo sh -c "sudo locale-gen zh_TW zh_TW.UTF-8;echo \"LC_CTYPE=zh_TW.UTF-8\" | sudo tee -a /etc/environment" &> /dev/null
- 刪除同一個image創出來的container指令:
docker ps -a | awk '{ print $1,$2 }' | grep centos:7 | awk '{print $1 }' | xargs -I {} docker rm {}
- 刪除特定名稱的images(通常是建images失敗都會變成none的名稱):
docker images | awk '{ print $1,$2,$3 }' | grep "<none>" | awk '{print $3}' | xargs -I {} docker rmi {}
- 嘗試建立image的時候,前幾次失敗的都會變成hash值,一口氣刪除的指令:
docker rmi `docker images --filter dangling=true -q` #Removes all those images.
- 將container容量排序:
docker ps -a --format '{{.Size}}\t{{.Names}}' | sed 's/ //' | sort -h -r
- 將image容量做排序:
docker images --format '{{.Size}}\t{{.Repository}}' | sed 's/ //' | sort -h -r
- remove dangling volume:
docker volume rm `docker volume ls -q -f dangling=true`