docker usage skills

create docker

nvidia-docker run -it --name bcaffe -v /:/home compute.nvidia.com/nvidia/caffe bash

start and open docker

## start and connect back to previously created container
$ nvidia-docker start bcaffe
$ nvidia-docker attach bcaffe

## delete the container
$ nvidia-docker rm bcaffe

make your own image

docker commit 01cdd31d9f73 bcaffe

See: https://segmentfault.com/a/1190000002567459

https://philipskokoh.github.io/blog/nvidia-docker-for-your-GPU-application-development

View currently running containers

docker ps

View existing mirrors

docker images

View all containers

docker ps -as

delete container

docker rm huwang-pytorch

See: http://www.simapple.com/340.html

Include exited containers, and list the size of the container.

rename image

docker tag IMAGEID(镜像id) REPOSITORY:TAG(仓库:标签)

#例子
docker tag 1febf44a3f77 huwang-bcaffe:v1.0

delete mirror

You need to stop the container derived from this image first

docker rmi [image_id]/[image_name]

push docker

step1——找到本地镜像的ID:docker images

step2——登陆Hub:docker login --username=username --password=password --email=email

step3——tag:docker tag <imageID> <namespace>/<image name>:<version tag eg latest>
简化写法为:docker tag firstimage YOUR_DOCKERHUB_NAME/firstimage

step4——push镜像:docker push <namespace>/<image name>

Reference
[1] Play with Docker in 5 minutes
[2] https://www.oschina.net/question/877522_239204
[3] https://stackoverflow.com/questions/41984399/denied-requested-access-to-the- resource-is-denied-docker

Existing container

huwang-hard
huwang-bcaffe
huwang-ncaffe
huwang-pytorch

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325948690&siteId=291194637