Procedure 1 Check the Docker version

[root@localhost ~]# docker version Client: version: 1.13.1 API version: 1.26 Package Version: Docker - 1.13.1-68. Gitdded712. El7. Centos. X86_64 Go version: go1.9.4 Git commit: dded712/1.13.1 Built: Tue Jul 17 18:34:48 2018 OS/Arch: Linux/AMD64 Server: Version: 1.13.1 API Version: 1.26 (minimum version 1.12) Package version: docker - 1.13.1-68. Gitdded712. El7. Centos. X86_64 Go version: Go1.9.4 Git commit: dded712/1.13.1 Built: Tue Jul 17 18:34:48 2018 OS/Arch: Linux/AMd64 Experimental: falseCopy the code
  1. Search for desired images
[root@localhost ~]# docker search centos7  
Copy the code
  1. Download an image
[root@localhost ~]# docker pull docker.io/openshift/base-centos7 
Copy the code
  1. Open multiple terminals to enter the same container
1. Check the container ID [root@localhost ~]# docker ps -a 2. Pid =$(docker inspect --format "{{.state.pid}}" c14ba651cc13) 3 Start container at new terminal [root@localhost ~]# nsenter --target $PID --mount -- UTS -- IPC --net -- PIDCopy the code

Reference: blog.csdn.net/elesos/arti… 5. Run an image

# docker run --runtime=nvidia -d -it -p 9000:9000 --name test -e NVIDIA_VISIBLE_DEVICES=0 -e NVIDIA_DRIVER_CAPABILITIES=compute,video,utility --volume /usr/local/cuda/lib64:/usr/local/cuda/lib64 -v /vision_output/test:/test A694A11D3693 -- Runtime = Nvidia: cudA-D-IT: long running in the background -p: specified port --name: user-defined name -e: Environment -v: Mount host /vision_output/test to container /testCopy the code
  1. Enter a container
# docker attach <inage id>
Copy the code
  1. Deleting a Mirror
# docker rmi  <image id>
Copy the code
  1. docker commit
# docker commit <container_id> <image_name>Copy the code
  1. tag
# docker tag -f centos/vision_dev centos/vision_dev:v1.0.1Copy the code

10 Delete: Mirrors with the same ID and different tags

# docker rmi registry/centos:latest
Copy the code
  1. Changing the Image Name
docker tag imageid name:tag
Copy the code