docker使用已拉取的纯净python3.8镜像(应该为debian版本)制作detectron2 docker 镜像

思路:利用docker run进入已拉取的python3.8镜像,然后在里面进行操作:包括安装vim,更换pip源,安装detectron2等,其中安装detectron2推荐这篇文章:
https://zhuanlan.zhihu.com/p/106853715
因为包括很多先导步骤,所以一定要看。
此外,detectron2 github上也有安装的命令,不过我是按照上面教程做的。

(base) xutengfei@xutengfei-G3-3579:~$ docker images
REPOSITORY                                                               TAG       IMAGE ID       CREATED        SIZE
<none>                                                                   <none>    1abba0409798   11 hours ago   3.94GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   1.0       cfea8d55bbf5   4 weeks ago    1.02GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   <none>    8fcfbebff40a   4 weeks ago    1.02GB
python                                                                   3.8       4d53664a7025   4 weeks ago    883MB
(base) xutengfei@xutengfei-G3-3579:~$ docker run -itd python:3.8
fdb8bd26a2d0594a4cc7d24ddd3c08f566476ec13a17d137d69e48f29b2f87ba
(base) xutengfei@xutengfei-G3-3579:~$ docker run -itd python:3.8 bash
19bdfa58c2260f47dbfe1df4a731c01153d10b162ac7f90c636b068cee81fd16
(base) xutengfei@xutengfei-G3-3579:~$ docker exec -it fdb8 bash
root@fdb8bd26a2d0:/# pip install vim
ERROR: Could not find a version that satisfies the requirement vim
ERROR: No matching distribution found for vim
WARNING: You are using pip version 21.0; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
root@fdb8bd26a2d0:/# /usr/local/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (21.0)
Collecting pip
  Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 19 kB/s 
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.0
    Uninstalling pip-21.0:
      Successfully uninstalled pip-21.0
Successfully installed pip-21.0.1
root@fdb8bd26a2d0:/# mkdir ~/.pip
root@fdb8bd26a2d0:/# cd ~/.pip
root@fdb8bd26a2d0:~/.pip# touch pip.conf
root@fdb8bd26a2d0:~/.pip# sudo
bash: sudo: command not found
root@fdb8bd26a2d0:~/.pip# gedit pip.conf
bash: gedit: command not found
root@fdb8bd26a2d0:~/.pip# cd /
root@fdb8bd26a2d0:/# apt-get install vim -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package vim
root@fdb8bd26a2d0:/# apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]                      
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [267 kB]
35% [4 Packages 1584 kB/7907 kB 20%]                                                                                                14.5 kB/s 7min 16s^C
root@fdb8bd26a2d0:/# cst
bash: cst: command not found
root@fdb8bd26a2d0:/# cat
^C
root@fdb8bd26a2d0:/# uname -a
Linux fdb8bd26a2d0 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021 x86_64 GNU/Linux
root@fdb8bd26a2d0:/# cat /proc/version
Linux version 5.8.0-44-generic (buildd@lgw01-amd64-054) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #50~20.04.1-Ubuntu SMP Wed Feb 10 21:07:30 UTC 2021
root@fdb8bd26a2d0:/# vi
bash: vi: command not found
root@fdb8bd26a2d0:/# apt-get update
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [267 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [9504 B]                                                                        
Fetched 6333 kB in 2min 22s (44.6 kB/s)                                                                                                               
Reading package lists... Done
root@fdb8bd26a2d0:/# apt-get install vim -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libgpm2 vim-common vim-runtime xxd
Suggested packages:
  gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
  libgpm2 vim vim-common vim-runtime xxd
0 upgraded, 5 newly installed, 0 to remove and 32 not upgraded.
Need to get 7425 kB of archives.
After this operation, 33.8 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 xxd amd64 2:8.1.0875-5 [140 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 vim-common all 2:8.1.0875-5 [195 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 libgpm2 amd64 1.20.7-5 [35.1 kB]                                                                 
Get:4 http://deb.debian.org/debian buster/main amd64 vim-runtime all 2:8.1.0875-5 [5775 kB]                                                           
Get:5 http://deb.debian.org/debian buster/main amd64 vim amd64 2:8.1.0875-5 [1280 kB]                                                                 
Fetched 7425 kB in 14min 48s (8361 B/s)                                                                                                               
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package xxd.
(Reading database ... 24600 files and directories currently installed.)
Preparing to unpack .../xxd_2%3a8.1.0875-5_amd64.deb ...
Unpacking xxd (2:8.1.0875-5) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a8.1.0875-5_all.deb ...
Unpacking vim-common (2:8.1.0875-5) ...
Selecting previously unselected package libgpm2:amd64.
Preparing to unpack .../libgpm2_1.20.7-5_amd64.deb ...
Unpacking libgpm2:amd64 (1.20.7-5) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a8.1.0875-5_all.deb ...
Adding 'diversion of /usr/share/vim/vim81/doc/help.txt to /usr/share/vim/vim81/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim81/doc/tags to /usr/share/vim/vim81/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.1.0875-5) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a8.1.0875-5_amd64.deb ...
Unpacking vim (2:8.1.0875-5) ...
Setting up libgpm2:amd64 (1.20.7-5) ...
Setting up xxd (2:8.1.0875-5) ...
Setting up vim-common (2:8.1.0875-5) ...
Setting up vim-runtime (2:8.1.0875-5) ...
Setting up vim (2:8.1.0875-5) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for mime-support (3.62) ...
root@fdb8bd26a2d0:/# cd ~/.pip
root@fdb8bd26a2d0:~/.pip# vim pip.conf
root@fdb8bd26a2d0:~/.pip# cd /
root@fdb8bd26a2d0:/# ls
bin  boot  dev	etc  home  lib	lib64  media  mnt  opt	proc  root  run  sbin  srv  sys  tmp  usr  var
root@fdb8bd26a2d0:/# cd home
root@fdb8bd26a2d0:/home# ls
root@fdb8bd26a2d0:/home# vim requirements.txt
root@fdb8bd26a2d0:/home# cdd /
bash: cdd: command not found
root@fdb8bd26a2d0:/home# cd /
root@fdb8bd26a2d0:/# pip install opencv-python
Configuration file could not be loaded.
File contains no section headers.
file: '/root/.pip/pip.conf', line: 1
'index-url = http://pypi.douban.com/simple #豆瓣源,可以换成其他的源\n'
root@fdb8bd26a2d0:/# vim /root/.pip/pip.conf
root@fdb8bd26a2d0:/# pip install opencv-python
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting opencv-python
  Downloading http://mirrors.aliyun.com/pypi/packages/2a/9a/ff309b530ac1b029bfdb9af3a95eaff0f5f45f6a2dbe37b3454ae8412f4c/opencv_python-4.5.1.48-cp38-cp38-manylinux2014_x86_64.whl (50.4 MB)
     |████████████████████████████████| 50.4 MB 12.2 MB/s 
Collecting numpy>=1.17.3
  Downloading http://mirrors.aliyun.com/pypi/packages/c7/e6/dccac76b7e825915ffb906beeba5a953597b6cfe1fe686b5276e122cb07c/numpy-1.20.1-cp38-cp38-manylinux2010_x86_64.whl (15.4 MB)
     |████████████████████████████████| 15.4 MB 11.0 MB/s 
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.20.1 opencv-python-4.5.1.48
root@fdb8bd26a2d0:/# pip install torch
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting torch
  Downloading http://mirrors.aliyun.com/pypi/packages/1d/a9/f349273a0327fdf20a73188c9c3aa7dbce68f86fad422eadd366fd2ed7a0/torch-1.7.1-cp38-cp38-manylinux1_x86_64.whl (776.8 MB)
     |████████████████████████████████| 776.8 MB 13.9 MB/s 
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from torch) (1.20.1)
Collecting typing-extensions
  Downloading http://mirrors.aliyun.com/pypi/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Installing collected packages: typing-extensions, torch
Successfully installed torch-1.7.1 typing-extensions-3.7.4.3
root@fdb8bd26a2d0:/# pip list
Package           Version
----------------- --------
numpy             1.20.1
opencv-python     4.5.1.48
pip               21.0.1
setuptools        52.0.0
torch             1.7.1
typing-extensions 3.7.4.3
wheel             0.36.2
root@fdb8bd26a2d0:/# pip install torchvision
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting torchvision
  Downloading http://mirrors.aliyun.com/pypi/packages/23/92/88de78810119baac2a3d9ae203d1a085df6ea5d3af557a151157436f81d3/torchvision-0.8.2-cp38-cp38-manylinux1_x86_64.whl (12.8 MB)
     |████████████████████████████████| 12.8 MB 9.5 MB/s 
Collecting pillow>=4.1.1
  Downloading http://mirrors.aliyun.com/pypi/packages/c9/57/a6c81c1d6b8973d288ec6df0993a71a61318c862afc1de71fd3aa1ba1dcd/Pillow-8.1.0-cp38-cp38-manylinux1_x86_64.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 10.0 MB/s 
Requirement already satisfied: torch==1.7.1 in /usr/local/lib/python3.8/site-packages (from torchvision) (1.7.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from torchvision) (1.20.1)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.8/site-packages (from torch==1.7.1->torchvision) (3.7.4.3)
Installing collected packages: pillow, torchvision
Successfully installed pillow-8.1.0 torchvision-0.8.2
root@fdb8bd26a2d0:/# pip install fvcore
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting fvcore
  Downloading http://mirrors.aliyun.com/pypi/packages/a7/e0/594bcd4a488e5a8806e49a1d09280fce99c87c0cc80d5172934565c744a3/fvcore-0.1.3.post20210227.tar.gz (47 kB)
     |████████████████████████████████| 47 kB 2.3 MB/s 
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from fvcore) (1.20.1)
Collecting yacs>=0.1.6
  Downloading http://mirrors.aliyun.com/pypi/packages/38/4f/fe9a4d472aa867878ce3bb7efb16654c5d63672b86dc0e6e953a67018433/yacs-0.1.8-py3-none-any.whl (14 kB)
Collecting pyyaml>=5.1
  Downloading http://mirrors.aliyun.com/pypi/packages/70/96/c7245e551b1cb496bfb95840ace55ca60f20d3d8e33d70faf8c78a976899/PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl (662 kB)
     |████████████████████████████████| 662 kB 4.2 MB/s 
Collecting tqdm
  Downloading http://mirrors.aliyun.com/pypi/packages/4e/8c/f1035bd24b0e352ddba7be320abc1603fc4c9976fcda6971ed287be59164/tqdm-4.58.0-py2.py3-none-any.whl (73 kB)
     |████████████████████████████████| 73 kB 8.6 MB/s 
Collecting termcolor>=1.1
  Downloading http://mirrors.aliyun.com/pypi/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz (3.9 kB)
Requirement already satisfied: Pillow in /usr/local/lib/python3.8/site-packages (from fvcore) (8.1.0)
Collecting tabulate
  Downloading http://mirrors.aliyun.com/pypi/packages/ca/80/7c0cad11bd99985cfe7c09427ee0b4f9bd6b048bd13d4ffb32c6db237dfb/tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting iopath>=0.1.2
  Downloading http://mirrors.aliyun.com/pypi/packages/07/e3/5d16bd5056730737e5d11deafb89e7e7435afa9c8bf8748f94019f1d2260/iopath-0.1.4.tar.gz (14 kB)
Collecting portalocker
  Downloading http://mirrors.aliyun.com/pypi/packages/82/22/e684c9e2e59b561dbe36538852e81849122c666c423448e3a5c99362c228/portalocker-2.2.1-py2.py3-none-any.whl (15 kB)
Building wheels for collected packages: fvcore, iopath, termcolor
  Building wheel for fvcore (setup.py) ... done
  Created wheel for fvcore: filename=fvcore-0.1.3.post20210227-py3-none-any.whl size=59000 sha256=981ef236691fb29bbd20ca027f304a2ede9cd4935e465b4426261cf2b079a9ec
  Stored in directory: /root/.cache/pip/wheels/01/9c/30/269863897b335f4fed61c5c2d6b9239cf157c0d8904a0cc398
  Building wheel for iopath (setup.py) ... done
  Created wheel for iopath: filename=iopath-0.1.4-py3-none-any.whl size=15571 sha256=cb8d960fd45b6595ccc0e8dbe12a45c440befa36590bf019db24e2accb6095f9
  Stored in directory: /root/.cache/pip/wheels/2b/6b/16/49981ed067ff274c0eb8acacb197fce9e61700bf941a26b933
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4829 sha256=4a79063c55a76a5728842174d27d57af488d7e2c3613820c1eacf789dd594cb3
  Stored in directory: /root/.cache/pip/wheels/70/a3/44/a0d1f4323f72671d0f675fbad1c4b33fcba882bbb3e542dfbc
Successfully built fvcore iopath termcolor
Installing collected packages: tqdm, pyyaml, portalocker, yacs, termcolor, tabulate, iopath, fvcore
Successfully installed fvcore-0.1.3.post20210227 iopath-0.1.4 portalocker-2.2.1 pyyaml-5.4.1 tabulate-0.8.9 termcolor-1.1.0 tqdm-4.58.0 yacs-0.1.8
root@fdb8bd26a2d0:/# pip3

Usage:   
  pip3 <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  cache                       Inspect and manage pip's wheel cache.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  debug                       Show information useful for debugging.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL
                              logging levels).
  --log <path>                Path to a verbose appending log.
  --no-input                  Disable prompting for input.
  --proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-
                              index.
  --no-color                  Suppress colored output.
  --no-python-version-warning
                              Silence deprecation warnings for upcoming unsupported Pythons.
  --use-feature <feature>     Enable new functionality, that may be backward incompatible.
  --use-deprecated <feature>  Enable deprecated functionality, that will be removed in the future.
root@fdb8bd26a2d0:/# pip3 install -U Cython
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting Cython
  Downloading http://mirrors.aliyun.com/pypi/packages/f9/f4/3a950e0146569f405ac3ea1233dc08bb2e2286cb7356de866807fde94f39/Cython-0.29.22-cp38-cp38-manylinux1_x86_64.whl (1.9 MB)
     |████████████████████████████████| 1.9 MB 23.7 MB/s 
Installing collected packages: Cython
Successfully installed Cython-0.29.22
root@fdb8bd26a2d0:/# pip3 install -U pycocotools
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pycocotools
  Downloading http://mirrors.aliyun.com/pypi/packages/de/df/056875d697c45182ed6d2ae21f62015896fdb841906fe48e7268e791c467/pycocotools-2.0.2.tar.gz (23 kB)
Requirement already satisfied: setuptools>=18.0 in /usr/local/lib/python3.8/site-packages (from pycocotools) (52.0.0)
Requirement already satisfied: cython>=0.27.3 in /usr/local/lib/python3.8/site-packages (from pycocotools) (0.29.22)
Collecting matplotlib>=2.1.0
  Downloading http://mirrors.aliyun.com/pypi/packages/ab/20/60cfe5d611ac86df07b7b1f9b9582f22f7eda5edbe2124ba85bdf3133822/matplotlib-3.3.4-cp38-cp38-manylinux1_x86_64.whl (11.6 MB)
     |████████████████████████████████| 11.6 MB 10.5 MB/s 
Collecting cycler>=0.10
  Downloading http://mirrors.aliyun.com/pypi/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
  Downloading http://mirrors.aliyun.com/pypi/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 10.4 MB/s 
Collecting kiwisolver>=1.0.1
  Downloading http://mirrors.aliyun.com/pypi/packages/99/04/41e831621ddec54f99e9e3693b8d4f2f583d7f3ee8df33bf9a7d6bf764de/kiwisolver-1.3.1-cp38-cp38-manylinux1_x86_64.whl (1.2 MB)
     |████████████████████████████████| 1.2 MB 10.1 MB/s 
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.8/site-packages (from matplotlib>=2.1.0->pycocotools) (8.1.0)
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.8/site-packages (from matplotlib>=2.1.0->pycocotools) (1.20.1)
Collecting python-dateutil>=2.1
  Downloading http://mirrors.aliyun.com/pypi/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |████████████████████████████████| 227 kB 8.1 MB/s 
Collecting six
  Downloading http://mirrors.aliyun.com/pypi/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl (10 kB)
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (setup.py) ... done
  Created wheel for pycocotools: filename=pycocotools-2.0.2-cp38-cp38-linux_x86_64.whl size=382498 sha256=15d625978cb5158b12457f5dfbb38f21c82761bb4393c680fccca07c931878f3
  Stored in directory: /root/.cache/pip/wheels/82/44/23/5d6c642046b39fba578ee4a390919ad4605dcfa52da8aedbb4
Successfully built pycocotools
Installing collected packages: six, python-dateutil, pyparsing, kiwisolver, cycler, matplotlib, pycocotools
Successfully installed cycler-0.10.0 kiwisolver-1.3.1 matplotlib-3.3.4 pycocotools-2.0.2 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.15.0
root@fdb8bd26a2d0:/# git
\usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout    Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Reapply commits on top of another base tip
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
root@fdb8bd26a2d0:/# git clone https://github.com.cnpmjs.org/facebookresearch/detectron2.git
Cloning into 'detectron2'...
remote: Enumerating objects: 103, done.
remote: Counting objects: 100% (103/103), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 10441 (delta 41), reused 53 (delta 28), pack-reused 10338
Receiving objects: 100% (10441/10441), 4.37 MiB | 2.30 MiB/s, done.
Resolving deltas: 100% (7510/7510), done.
root@fdb8bd26a2d0:/# ls
bin  boot  detectron2  dev  etc  home  lib  lib64  media  mnt  opt  proc  root	run  sbin  srv	sys  tmp  usr  var
root@fdb8bd26a2d0:/# cd detectron2 && pip install -e .
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Obtaining file:///detectron2
Requirement already satisfied: termcolor>=1.1 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (1.1.0)
Requirement already satisfied: Pillow>=7.1 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (8.1.0)
Requirement already satisfied: yacs>=0.1.6 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (0.1.8)
Requirement already satisfied: tabulate in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (0.8.9)
Collecting cloudpickle
  Downloading http://mirrors.aliyun.com/pypi/packages/e7/e3/898487e5dbeb612054cf2e0c188463acb358167fef749c53c8bb8918cea1/cloudpickle-1.6.0-py3-none-any.whl (23 kB)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (3.3.4)
Requirement already satisfied: tqdm>4.29.0 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (4.58.0)
Collecting tensorboard
  Downloading http://mirrors.aliyun.com/pypi/packages/64/21/eebd23060763fedeefb78bc2b286e00fa1d8abda6f70efa2ee08c28af0d4/tensorboard-2.4.1-py3-none-any.whl (10.6 MB)
     |████████████████████████████████| 10.6 MB 3.9 MB/s 
Requirement already satisfied: fvcore<0.1.4,>=0.1.3 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (0.1.3.post20210227)
Requirement already satisfied: iopath>=0.1.2 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (0.1.4)
Requirement already satisfied: pycocotools>=2.0.2 in /usr/local/lib/python3.8/site-packages (from detectron2==0.3) (2.0.2)
Collecting future
  Downloading http://mirrors.aliyun.com/pypi/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 8.2 MB/s 
Collecting pydot
  Downloading http://mirrors.aliyun.com/pypi/packages/ea/76/75b1bb82e9bad3e3d656556eaa353d8cd17c4254393b08ec9786ac8ed273/pydot-1.4.2-py2.py3-none-any.whl (21 kB)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.8/site-packages (from fvcore<0.1.4,>=0.1.3->detectron2==0.3) (5.4.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from fvcore<0.1.4,>=0.1.3->detectron2==0.3) (1.20.1)
Requirement already satisfied: portalocker in /usr/local/lib/python3.8/site-packages (from iopath>=0.1.2->detectron2==0.3) (2.2.1)
Requirement already satisfied: cython>=0.27.3 in /usr/local/lib/python3.8/site-packages (from pycocotools>=2.0.2->detectron2==0.3) (0.29.22)
Requirement already satisfied: setuptools>=18.0 in /usr/local/lib/python3.8/site-packages (from pycocotools>=2.0.2->detectron2==0.3) (52.0.0)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.8/site-packages (from matplotlib->detectron2==0.3) (0.10.0)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.8/site-packages (from matplotlib->detectron2==0.3) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.8/site-packages (from matplotlib->detectron2==0.3) (1.3.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /usr/local/lib/python3.8/site-packages (from matplotlib->detectron2==0.3) (2.4.7)
Requirement already satisfied: six in /usr/local/lib/python3.8/site-packages (from cycler>=0.10->matplotlib->detectron2==0.3) (1.15.0)
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Downloading http://mirrors.aliyun.com/pypi/packages/81/67/e2c34bb0628984c7ce71cce6ba6964cb29c418873847fc285f826e032e6e/google_auth_oauthlib-0.4.2-py2.py3-none-any.whl (18 kB)
Collecting protobuf>=3.6.0
  Downloading http://mirrors.aliyun.com/pypi/packages/72/66/da24509f88b4ebe8e2abe26be3ff32f49bef41439756160a4c24b1aa1b59/protobuf-3.15.3-cp38-cp38-manylinux1_x86_64.whl (1.0 MB)
     |████████████████████████████████| 1.0 MB 5.1 MB/s 
Collecting requests<3,>=2.21.0
  Downloading http://mirrors.aliyun.com/pypi/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 5.6 MB/s 
Collecting absl-py>=0.4
  Downloading http://mirrors.aliyun.com/pypi/packages/bc/58/0aa6fb779dc69cfc811df3398fcbeaeefbf18561b6e36b185df0782781cc/absl_py-0.11.0-py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 15.1 MB/s 
Collecting werkzeug>=0.11.15
  Downloading http://mirrors.aliyun.com/pypi/packages/cc/94/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
     |████████████████████████████████| 298 kB 15.1 MB/s 
Collecting tensorboard-plugin-wit>=1.6.0
  Downloading http://mirrors.aliyun.com/pypi/packages/1a/c1/499e600ba0c618b451cd9c425ae1c177249940a2086316552fee7d86c954/tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB)
     |████████████████████████████████| 781 kB 8.7 MB/s 
Collecting google-auth<2,>=1.6.3
  Downloading http://mirrors.aliyun.com/pypi/packages/bf/6b/a364a4ad2a9d25904a19f53b9474ae9666b96e0653a6ca38492baf1bcf05/google_auth-1.27.0-py2.py3-none-any.whl (135 kB)
     |████████████████████████████████| 135 kB 6.4 MB/s 
Collecting markdown>=2.6.8
  Downloading http://mirrors.aliyun.com/pypi/packages/6e/33/1ae0f71395e618d6140fbbc9587cc3156591f748226075e0f7d6f9176522/Markdown-3.3.4-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 16.7 MB/s 
Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.8/site-packages (from tensorboard->detectron2==0.3) (0.36.2)
Collecting grpcio>=1.24.3
  Downloading http://mirrors.aliyun.com/pypi/packages/72/11/d2a26271c7d885c1011157780567a1f151780be78563a59509cf7742cd67/grpcio-1.36.0-cp38-cp38-manylinux2014_x86_64.whl (4.1 MB)
     |████████████████████████████████| 4.1 MB 2.5 MB/s 
Collecting cachetools<5.0,>=2.0.0
  Downloading http://mirrors.aliyun.com/pypi/packages/bb/72/8df2e0dc991f1a1d2c6869404e7622e8ee50d80bff357dbb57c3df70305b/cachetools-4.2.1-py3-none-any.whl (12 kB)
Collecting pyasn1-modules>=0.2.1
  Downloading http://mirrors.aliyun.com/pypi/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     |████████████████████████████████| 155 kB 19.0 MB/s 
Collecting rsa<5,>=3.1.4
  Downloading http://mirrors.aliyun.com/pypi/packages/e9/93/0c0f002031f18b53af7a6166103c02b9c0667be528944137cc954ec921b3/rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting requests-oauthlib>=0.7.0
  Downloading http://mirrors.aliyun.com/pypi/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB)
Collecting pyasn1<0.5.0,>=0.4.6
  Downloading http://mirrors.aliyun.com/pypi/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 12.5 MB/s 
Collecting urllib3<1.27,>=1.21.1
  Downloading http://mirrors.aliyun.com/pypi/packages/23/fc/8a49991f7905261f9ca9df5aa9b58363c3c821ce3e7f671895442b7100f2/urllib3-1.26.3-py2.py3-none-any.whl (137 kB)
     |████████████████████████████████| 137 kB 10.6 MB/s 
Collecting idna<3,>=2.5
  Downloading http://mirrors.aliyun.com/pypi/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 6.2 MB/s 
Collecting certifi>=2017.4.17
  Downloading http://mirrors.aliyun.com/pypi/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 9.5 MB/s 
Collecting chardet<5,>=3.0.2
  Downloading http://mirrors.aliyun.com/pypi/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     |████████████████████████████████| 178 kB 8.2 MB/s 
Collecting oauthlib>=3.0.0
  Downloading http://mirrors.aliyun.com/pypi/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 10.7 MB/s 
Building wheels for collected packages: future
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491059 sha256=dcfcb256f9e082f667530b272b3377847687663a1d62b94846f4c2cdb57496e8
  Stored in directory: /root/.cache/pip/wheels/81/66/8d/d48705a24664587f61557810d796603caef2610c98b3a24b44
Successfully built future
Installing collected packages: urllib3, pyasn1, idna, chardet, certifi, rsa, requests, pyasn1-modules, oauthlib, cachetools, requests-oauthlib, google-auth, werkzeug, tensorboard-plugin-wit, protobuf, markdown, grpcio, google-auth-oauthlib, absl-py, tensorboard, pydot, future, cloudpickle, detectron2
  Running setup.py develop for detectron2
Successfully installed absl-py-0.11.0 cachetools-4.2.1 certifi-2020.12.5 chardet-4.0.0 cloudpickle-1.6.0 detectron2 future-0.18.2 google-auth-1.27.0 google-auth-oauthlib-0.4.2 grpcio-1.36.0 idna-2.10 markdown-3.3.4 oauthlib-3.1.0 protobuf-3.15.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 pydot-1.4.2 requests-2.25.1 requests-oauthlib-1.3.0 rsa-4.7.2 tensorboard-2.4.1 tensorboard-plugin-wit-1.8.0 urllib3-1.26.3 werkzeug-1.0.1
root@fdb8bd26a2d0:/detectron2# ls
GETTING_STARTED.md  LICENSE	  README.md  configs   demo	   detectron2.egg-info	docker	projects   setup.py  tools
INSTALL.md	    MODEL_ZOO.md  build      datasets  detectron2  dev			docs	setup.cfg  tests
root@fdb8bd26a2d0:/detectron2# cd /
root@fdb8bd26a2d0:/# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
root@fdb8bd26a2d0:/# exit
(base) xutengfei@xutengfei-G3-3579:~$ docker ps
CONTAINER ID   IMAGE        COMMAND     CREATED       STATUS       PORTS     NAMES
19bdfa58c226   python:3.8   "bash"      2 hours ago   Up 2 hours             agitated_bartik
fdb8bd26a2d0   python:3.8   "python3"   2 hours ago   Up 2 hours             epic_galileo
(base) xutengfei@xutengfei-G3-3579:~$ docker commit -m="python for cv" -a="xutengfei" fdb8bd26a2d0 python_cv:add-detectron2
sha256:c789099bd250f17b40e71015811248bd1dabf2c310a6de77393b7d99b04f896d
(base) xutengfei@xutengfei-G3-3579:~$ docker images
REPOSITORY                                                               TAG              IMAGE ID       CREATED          SIZE
python_cv                                                                add-detectron2   c789099bd250   59 seconds ago   2.96GB
<none>                                                                   <none>           1abba0409798   15 hours ago     3.94GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   1.0              cfea8d55bbf5   4 weeks ago      1.02GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   <none>           8fcfbebff40a   4 weeks ago      1.02GB
python                                                                   3.8              4d53664a7025   4 weeks ago      883MB
(base) xutengfei@xutengfei-G3-3579:~$ 




今晚重建了一个镜像,即用原容器替换为国内源并更新了软件源,并下载了包以解决:
ImportError: libGL.so.1: cannot open shared object file: No such file or directory——docker容器内问题报错

(base) xutengfei@xutengfei-G3-3579:~$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
(base) xutengfei@xutengfei-G3-3579:~$ docker ps -a
CONTAINER ID   IMAGE          COMMAND                  CREATED        STATUS                     PORTS     NAMES
19bdfa58c226   python:3.8     "bash"                   9 hours ago    Exited (0) 7 hours ago               agitated_bartik
fdb8bd26a2d0   python:3.8     "python3"                9 hours ago    Exited (137) 7 hours ago             epic_galileo
ffa4aeed9ec0   1abba0409798   "/bin/sh -c 'python …"   22 hours ago   Exited (2) 22 hours ago              vigilant_meninsky
cbe8ea3c4779   8fcfbebff40a   "sh run.sh"              4 weeks ago    Created                              mycontainer1
(base) xutengfei@xutengfei-G3-3579:~$ docker exec -it fdb8 bash
Error response from daemon: Container fdb8bd26a2d0594a4cc7d24ddd3c08f566476ec13a17d137d69e48f29b2f87ba is not running
(base) xutengfei@xutengfei-G3-3579:~$ docker start fdb8bd26a2d0
fdb8bd26a2d0
(base) xutengfei@xutengfei-G3-3579:~$ docker exec -it fdb8 bash
root@fdb8bd26a2d0:/# mv /etc/apt/sources.list /etc/apt/sources.list.bak
root@fdb8bd26a2d0:/# cat > /etc/apt/sources.list << EOF
> deb http://mirrors.163.com/debian/ buster main contrib non-free
> # deb-src http://mirrors.163.com/debian/ buster main contrib non-free
> deb http://mirrors.163.com/debian/ buster-updates main contrib non-free
> # deb-src http://mirrors.163.com/debian/ buster-updates main contrib non-free
> deb http://mirrors.163.com/debian/ buster-backports main contrib non-free
> # deb-src http://mirrors.163.com/debian/ buster-backports main contrib non-free
> deb http://mirrors.163.com/debian-security buster/updates main contrib non-free
> # deb-src http://mirrors.163.com/debian-security buster/updates main contrib non-free
> EOF
root@fdb8bd26a2d0:/# apt-get update
Get:1 http://mirrors.163.com/debian buster InRelease [122 kB]
Get:2 http://mirrors.163.com/debian buster-updates InRelease [51.9 kB]
Get:3 http://mirrors.163.com/debian buster-backports InRelease [46.7 kB]
Get:4 http://mirrors.163.com/debian-security buster/updates InRelease [65.4 kB]
Get:5 http://mirrors.163.com/debian buster/main amd64 Packages [7907 kB]
Get:6 http://mirrors.163.com/debian buster/non-free amd64 Packages [87.7 kB]
Get:7 http://mirrors.163.com/debian buster/contrib amd64 Packages [50.1 kB]
Get:8 http://mirrors.163.com/debian buster-updates/non-free amd64 Packages [604 B]
Get:9 http://mirrors.163.com/debian buster-updates/main amd64 Packages [9504 B]
Get:10 http://mirrors.163.com/debian buster-backports/contrib amd64 Packages [9688 B]
Get:11 http://mirrors.163.com/debian buster-backports/non-free amd64 Packages [34.5 kB]
Get:12 http://mirrors.163.com/debian buster-backports/main amd64 Packages [451 kB]
Get:13 http://mirrors.163.com/debian-security buster/updates/non-free amd64 Packages [556 B]
Get:14 http://mirrors.163.com/debian-security buster/updates/main amd64 Packages [267 kB]
Fetched 9103 kB in 4s (2116 kB/s)                        
Reading package lists... Done
root@fdb8bd26a2d0:/# apt-get install sudo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 32 not upgraded.
Need to get 1244 kB of archives.
After this operation, 3882 kB of additional disk space will be used.
Get:1 http://mirrors.163.com/debian buster/main amd64 sudo amd64 1.8.27-1+deb10u3 [1244 kB]
Fetched 1244 kB in 0s (3483 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package sudo.
(Reading database ... 26489 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.27-1+deb10u3_amd64.deb ...
Unpacking sudo (1.8.27-1+deb10u3) ...
Setting up sudo (1.8.27-1+deb10u3) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
root@fdb8bd26a2d0:/# sudo apt install libgl1-mesa-glx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0
  libglx-mesa0 libglx0 libllvm7 libpciaccess0 libsensors-config libsensors5 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0
  libxcb-present0 libxcb-sync1 libxdamage1 libxfixes3 libxshmfence1 libxxf86vm1
Suggested packages:
  pciutils lm-sensors
The following NEW packages will be installed:
  libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libgl1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa
  libglvnd0 libglx-mesa0 libglx0 libllvm7 libpciaccess0 libsensors-config libsensors5 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0
  libxcb-glx0 libxcb-present0 libxcb-sync1 libxdamage1 libxfixes3 libxshmfence1 libxxf86vm1
0 upgraded, 27 newly installed, 0 to remove and 32 not upgraded.
Need to get 21.3 MB of archives.
After this operation, 214 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.163.com/debian buster/main amd64 libdrm-common all 2.4.97-1 [13.8 kB]
Get:2 http://mirrors.163.com/debian buster/main amd64 libdrm2 amd64 2.4.97-1 [39.7 kB]
Get:3 http://mirrors.163.com/debian buster/main amd64 libdrm-amdgpu1 amd64 2.4.97-1 [27.3 kB]
Get:4 http://mirrors.163.com/debian buster/main amd64 libpciaccess0 amd64 0.14-1 [53.5 kB]
Get:5 http://mirrors.163.com/debian buster/main amd64 libdrm-intel1 amd64 2.4.97-1 [69.8 kB]
Get:6 http://mirrors.163.com/debian buster/main amd64 libdrm-nouveau2 amd64 2.4.97-1 [26.3 kB]
Get:7 http://mirrors.163.com/debian buster/main amd64 libdrm-radeon1 amd64 2.4.97-1 [31.1 kB]
Get:8 http://mirrors.163.com/debian buster/main amd64 libglapi-mesa amd64 18.3.6-2+deb10u1 [66.3 kB]
Get:9 http://mirrors.163.com/debian buster/main amd64 libllvm7 amd64 1:7.0.1-8+deb10u2 [13.1 MB]
Get:10 http://mirrors.163.com/debian buster/main amd64 libsensors-config all 1:3.5.0-3 [31.6 kB]
Get:11 http://mirrors.163.com/debian buster/main amd64 libsensors5 amd64 1:3.5.0-3 [52.6 kB]
Get:12 http://mirrors.163.com/debian buster/main amd64 libgl1-mesa-dri amd64 18.3.6-2+deb10u1 [6685 kB]
Get:13 http://mirrors.163.com/debian buster/main amd64 libglvnd0 amd64 1.1.0-1 [48.6 kB]                                                 
Get:14 http://mirrors.163.com/debian buster/main amd64 libx11-xcb1 amd64 2:1.6.7-1+deb10u1 [190 kB]                                      
Get:15 http://mirrors.163.com/debian buster/main amd64 libxcb-dri2-0 amd64 1.13.1-2 [101 kB]                                             
Get:16 http://mirrors.163.com/debian buster/main amd64 libxcb-dri3-0 amd64 1.13.1-2 [100 kB]                                             
Get:17 http://mirrors.163.com/debian buster/main amd64 libxcb-glx0 amd64 1.13.1-2 [116 kB]                                               
Get:18 http://mirrors.163.com/debian buster/main amd64 libxcb-present0 amd64 1.13.1-2 [99.1 kB]                                          
Get:19 http://mirrors.163.com/debian buster/main amd64 libxcb-sync1 amd64 1.13.1-2 [103 kB]                                              
Get:20 http://mirrors.163.com/debian buster/main amd64 libxfixes3 amd64 1:5.0.3-1 [21.9 kB]                                              
Get:21 http://mirrors.163.com/debian buster/main amd64 libxdamage1 amd64 1:1.1.4-3+b3 [14.9 kB]                                          
Get:22 http://mirrors.163.com/debian buster/main amd64 libxshmfence1 amd64 1.3-1 [8820 B]                                                
Get:23 http://mirrors.163.com/debian buster/main amd64 libxxf86vm1 amd64 1:1.1.4-1+b2 [20.8 kB]                                          
Get:24 http://mirrors.163.com/debian buster/main amd64 libglx-mesa0 amd64 18.3.6-2+deb10u1 [180 kB]                                      
Get:25 http://mirrors.163.com/debian buster/main amd64 libglx0 amd64 1.1.0-1 [30.0 kB]                                                   
Get:26 http://mirrors.163.com/debian buster/main amd64 libgl1 amd64 1.1.0-1 [91.1 kB]                                                    
Get:27 http://mirrors.163.com/debian buster/main amd64 libgl1-mesa-glx amd64 18.3.6-2+deb10u1 [47.4 kB]                                  
Fetched 21.3 MB in 8s (2604 kB/s)                                                                                                        
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libdrm-common.
(Reading database ... 26610 files and directories currently installed.)
Preparing to unpack .../00-libdrm-common_2.4.97-1_all.deb ...
Unpacking libdrm-common (2.4.97-1) ...
Selecting previously unselected package libdrm2:amd64.
Preparing to unpack .../01-libdrm2_2.4.97-1_amd64.deb ...
Unpacking libdrm2:amd64 (2.4.97-1) ...
Selecting previously unselected package libdrm-amdgpu1:amd64.
Preparing to unpack .../02-libdrm-amdgpu1_2.4.97-1_amd64.deb ...
Unpacking libdrm-amdgpu1:amd64 (2.4.97-1) ...
Selecting previously unselected package libpciaccess0:amd64.
Preparing to unpack .../03-libpciaccess0_0.14-1_amd64.deb ...
Unpacking libpciaccess0:amd64 (0.14-1) ...
Selecting previously unselected package libdrm-intel1:amd64.
Preparing to unpack .../04-libdrm-intel1_2.4.97-1_amd64.deb ...
Unpacking libdrm-intel1:amd64 (2.4.97-1) ...
Selecting previously unselected package libdrm-nouveau2:amd64.
Preparing to unpack .../05-libdrm-nouveau2_2.4.97-1_amd64.deb ...
Unpacking libdrm-nouveau2:amd64 (2.4.97-1) ...
Selecting previously unselected package libdrm-radeon1:amd64.
Preparing to unpack .../06-libdrm-radeon1_2.4.97-1_amd64.deb ...
Unpacking libdrm-radeon1:amd64 (2.4.97-1) ...
Selecting previously unselected package libglapi-mesa:amd64.
Preparing to unpack .../07-libglapi-mesa_18.3.6-2+deb10u1_amd64.deb ...
Unpacking libglapi-mesa:amd64 (18.3.6-2+deb10u1) ...
Selecting previously unselected package libllvm7:amd64.
Preparing to unpack .../08-libllvm7_1%3a7.0.1-8+deb10u2_amd64.deb ...
Unpacking libllvm7:amd64 (1:7.0.1-8+deb10u2) ...
Selecting previously unselected package libsensors-config.
Preparing to unpack .../09-libsensors-config_1%3a3.5.0-3_all.deb ...
Unpacking libsensors-config (1:3.5.0-3) ...
Selecting previously unselected package libsensors5:amd64.
Preparing to unpack .../10-libsensors5_1%3a3.5.0-3_amd64.deb ...
Unpacking libsensors5:amd64 (1:3.5.0-3) ...
Selecting previously unselected package libgl1-mesa-dri:amd64.
Preparing to unpack .../11-libgl1-mesa-dri_18.3.6-2+deb10u1_amd64.deb ...
Unpacking libgl1-mesa-dri:amd64 (18.3.6-2+deb10u1) ...
Selecting previously unselected package libglvnd0:amd64.
Preparing to unpack .../12-libglvnd0_1.1.0-1_amd64.deb ...
Unpacking libglvnd0:amd64 (1.1.0-1) ...
Selecting previously unselected package libx11-xcb1:amd64.
Preparing to unpack .../13-libx11-xcb1_2%3a1.6.7-1+deb10u1_amd64.deb ...
Unpacking libx11-xcb1:amd64 (2:1.6.7-1+deb10u1) ...
Selecting previously unselected package libxcb-dri2-0:amd64.
Preparing to unpack .../14-libxcb-dri2-0_1.13.1-2_amd64.deb ...
Unpacking libxcb-dri2-0:amd64 (1.13.1-2) ...
Selecting previously unselected package libxcb-dri3-0:amd64.
Preparing to unpack .../15-libxcb-dri3-0_1.13.1-2_amd64.deb ...
Unpacking libxcb-dri3-0:amd64 (1.13.1-2) ...
Selecting previously unselected package libxcb-glx0:amd64.
Preparing to unpack .../16-libxcb-glx0_1.13.1-2_amd64.deb ...
Unpacking libxcb-glx0:amd64 (1.13.1-2) ...
Selecting previously unselected package libxcb-present0:amd64.
Preparing to unpack .../17-libxcb-present0_1.13.1-2_amd64.deb ...
Unpacking libxcb-present0:amd64 (1.13.1-2) ...
Selecting previously unselected package libxcb-sync1:amd64.
Preparing to unpack .../18-libxcb-sync1_1.13.1-2_amd64.deb ...
Unpacking libxcb-sync1:amd64 (1.13.1-2) ...
Selecting previously unselected package libxfixes3:amd64.
Preparing to unpack .../19-libxfixes3_1%3a5.0.3-1_amd64.deb ...
Unpacking libxfixes3:amd64 (1:5.0.3-1) ...
Selecting previously unselected package libxdamage1:amd64.
Preparing to unpack .../20-libxdamage1_1%3a1.1.4-3+b3_amd64.deb ...
Unpacking libxdamage1:amd64 (1:1.1.4-3+b3) ...
Selecting previously unselected package libxshmfence1:amd64.
Preparing to unpack .../21-libxshmfence1_1.3-1_amd64.deb ...
Unpacking libxshmfence1:amd64 (1.3-1) ...
Selecting previously unselected package libxxf86vm1:amd64.
Preparing to unpack .../22-libxxf86vm1_1%3a1.1.4-1+b2_amd64.deb ...
Unpacking libxxf86vm1:amd64 (1:1.1.4-1+b2) ...
Selecting previously unselected package libglx-mesa0:amd64.
Preparing to unpack .../23-libglx-mesa0_18.3.6-2+deb10u1_amd64.deb ...
Unpacking libglx-mesa0:amd64 (18.3.6-2+deb10u1) ...
Selecting previously unselected package libglx0:amd64.
Preparing to unpack .../24-libglx0_1.1.0-1_amd64.deb ...
Unpacking libglx0:amd64 (1.1.0-1) ...
Selecting previously unselected package libgl1:amd64.
Preparing to unpack .../25-libgl1_1.1.0-1_amd64.deb ...
Unpacking libgl1:amd64 (1.1.0-1) ...
Selecting previously unselected package libgl1-mesa-glx:amd64.
Preparing to unpack .../26-libgl1-mesa-glx_18.3.6-2+deb10u1_amd64.deb ...
Unpacking libgl1-mesa-glx:amd64 (18.3.6-2+deb10u1) ...
Setting up libxcb-dri3-0:amd64 (1.13.1-2) ...
Setting up libx11-xcb1:amd64 (2:1.6.7-1+deb10u1) ...
Setting up libpciaccess0:amd64 (0.14-1) ...
Setting up libglvnd0:amd64 (1.1.0-1) ...
Setting up libxcb-glx0:amd64 (1.13.1-2) ...
Setting up libsensors-config (1:3.5.0-3) ...
Setting up libxxf86vm1:amd64 (1:1.1.4-1+b2) ...
Setting up libxcb-present0:amd64 (1.13.1-2) ...
Setting up libxfixes3:amd64 (1:5.0.3-1) ...
Setting up libxcb-sync1:amd64 (1.13.1-2) ...
Setting up libsensors5:amd64 (1:3.5.0-3) ...
Setting up libglapi-mesa:amd64 (18.3.6-2+deb10u1) ...
Setting up libxcb-dri2-0:amd64 (1.13.1-2) ...
Setting up libxshmfence1:amd64 (1.3-1) ...
Setting up libllvm7:amd64 (1:7.0.1-8+deb10u2) ...
Setting up libdrm-common (2.4.97-1) ...
Setting up libxdamage1:amd64 (1:1.1.4-3+b3) ...
Setting up libdrm2:amd64 (2.4.97-1) ...
Setting up libdrm-amdgpu1:amd64 (2.4.97-1) ...
Setting up libdrm-nouveau2:amd64 (2.4.97-1) ...
Setting up libdrm-radeon1:amd64 (2.4.97-1) ...
Setting up libdrm-intel1:amd64 (2.4.97-1) ...
Setting up libgl1-mesa-dri:amd64 (18.3.6-2+deb10u1) ...
Setting up libglx-mesa0:amd64 (18.3.6-2+deb10u1) ...
Setting up libglx0:amd64 (1.1.0-1) ...
Setting up libgl1:amd64 (1.1.0-1) ...
Setting up libgl1-mesa-glx:amd64 (18.3.6-2+deb10u1) ...
Processing triggers for libc-bin (2.28-10) ...
root@fdb8bd26a2d0:/# exit
(base) xutengfei@xutengfei-G3-3579:~$ docker commit -m="python for cv" -a="xutengfei" fdb8bd26a2d0 python_cv:add-detectron2
sha256:5f0eb96d4de50c5ecf7e850fd3b22541cf261abebfbf12a88d03f5204c1e9118
(base) xutengfei@xutengfei-G3-3579:~$ docker images
REPOSITORY                                                               TAG              IMAGE ID       CREATED             SIZE
python_cv                                                                add-detectron2   5f0eb96d4de5   3 minutes ago       3.05GB
registry.cn-shenzhen.aliyuncs.com/xutengfei123/hand_for_reshensai        1.0              f44389ec5e09   About an hour ago   3.53GB
<none>                                                                   <none>           1abba0409798   22 hours ago        3.94GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   1.0              cfea8d55bbf5   4 weeks ago         1.02GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   <none>           8fcfbebff40a   4 weeks ago         1.02GB
python                                                                   3.8              4d53664a7025   4 weeks ago         883MB

今晚提交后,出现问题是系统找不到nvidia驱动:
参考
https://www.cnblogs.com/chester-cs/p/14444247.html
非常有用:
我按照官网安装了nvidia-docker2方能成功。

(base) xutengfei@xutengfei-G3-3579:~$ docker run -itd --gpus all --name^C
(base) xutengfei@xutengfei-G3-3579:~$ docker images
REPOSITORY                                                               TAG              IMAGE ID       CREATED             SIZE
registry.cn-shenzhen.aliyuncs.com/xutengfei123/hand_for_reshensai        1.1              19e2a939983f   About an hour ago   3.63GB
python_cv                                                                add-detectron2   5f0eb96d4de5   About an hour ago   3.05GB
registry.cn-shenzhen.aliyuncs.com/xutengfei123/hand_for_reshensai        1.0              f44389ec5e09   3 hours ago         3.53GB
<none>                                                                   <none>           1abba0409798   23 hours ago        3.94GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   1.0              cfea8d55bbf5   4 weeks ago         1.02GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   <none>           8fcfbebff40a   4 weeks ago         1.02GB
python                                                                   3.8              4d53664a7025   4 weeks ago         883MB
(base) xutengfei@xutengfei-G3-3579:~$ docker run -itd --gpus all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all 5f0eb96d4de5
85376a7d0f99a66f7a5f542d26b3c371ef667b1df2bca9f1b8abac81930e9fe8
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
(base) xutengfei@xutengfei-G3-3579:~$ docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/home/xutengfei/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with
                           "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/home/xutengfei/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/home/xutengfei/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/home/xutengfei/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  app*        Docker App (Docker Inc., v0.9.1-beta3)
  builder     Manage builds
  buildx*     Build with BuildKit (Docker Inc., v0.5.1-docker)
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
(base) xutengfei@xutengfei-G3-3579:~$ docker -v
Docker version 20.10.3, build 48d30b5
(base) xutengfei@xutengfei-G3-3579:~$ docker exec -itd 85376a7d0f99a66f7a5f542d26b3c371ef667b1df2bca9f1b8abac81930e9fe8 bash
Error response from daemon: Container 85376a7d0f99a66f7a5f542d26b3c371ef667b1df2bca9f1b8abac81930e9fe8 is not running
(base) xutengfei@xutengfei-G3-3579:~$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
>    && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
>    && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
[sudo] xutengfei 的密码: 
OK
deb https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) /
#deb https://nvidia.github.io/libnvidia-container/experimental/ubuntu18.04/$(ARCH) /
deb https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/$(ARCH) /
#deb https://nvidia.github.io/nvidia-container-runtime/experimental/ubuntu18.04/$(ARCH) /
deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/$(ARCH) /
(base) xutengfei@xutengfei-G3-3579:~$ sudo apt-get update
命中:1 http://dl.google.com/linux/chrome/deb stable InRelease
命中:2 https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease                                                                               
命中:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease                                                                                     
获取:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease [114 kB]                           
获取:5 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  InRelease [1,484 B]
获取:6 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  InRelease [1,481 B]
获取:7 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  InRelease [1,129 B]
获取:8 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  Packages [11.0 kB]
获取:9 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease [101 kB]
获取:10 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  Packages [6,936 B]
获取:11 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  Packages [4,332 B]
获取:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease [109 kB]
获取:13 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 DEP-11 Metadata [264 kB]
获取:14 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 DEP-11 Metadata [302 kB]
获取:15 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
获取:16 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,768 B]
获取:17 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 DEP-11 Metadata [24.3 kB]
获取:18 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe amd64 DEP-11 Metadata [58.2 kB]
获取:19 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe DEP-11 64x64 Icons [46.0 kB]
已下载 1,049 kB,耗时 2秒 (459 kB/s)                                      
正在读取软件包列表... 完成
(base) xutengfei@xutengfei-G3-3579:~$ sudo apt-get install -y nvidia-docker2
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  libfprint-2-tod1 libid3tag0 libimlib2 tint2
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  libnvidia-container-tools libnvidia-container1 nvidia-container-runtime nvidia-container-toolkit
下列【新】软件包将被安装:
  libnvidia-container-tools libnvidia-container1 nvidia-container-runtime nvidia-container-toolkit nvidia-docker2
升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 6 个软件包未被升级。
需要下载 1,604 kB 的归档。
解压缩后会消耗 4,936 kB 的额外空间。
获取:1 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  libnvidia-container1 1.3.3-1 [68.0 kB]
获取:2 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  libnvidia-container-tools 1.3.3-1 [20.7 kB]
获取:3 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  nvidia-container-toolkit 1.4.2-1 [764 kB]
获取:4 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  nvidia-container-runtime 3.4.2-1 [745 kB]
获取:5 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  nvidia-docker2 2.5.0-1 [5,912 B]
已下载 1,604 kB,耗时 3秒 (554 kB/s) 
正在选中未选择的软件包 libnvidia-container1:amd64。
(正在读取数据库 ... 系统当前共安装有 433957 个文件和目录。)
准备解压 .../libnvidia-container1_1.3.3-1_amd64.deb  ...
正在解压 libnvidia-container1:amd64 (1.3.3-1) ...
正在选中未选择的软件包 libnvidia-container-tools。
准备解压 .../libnvidia-container-tools_1.3.3-1_amd64.deb  ...
正在解压 libnvidia-container-tools (1.3.3-1) ...
正在选中未选择的软件包 nvidia-container-toolkit。
准备解压 .../nvidia-container-toolkit_1.4.2-1_amd64.deb  ...
正在解压 nvidia-container-toolkit (1.4.2-1) ...
正在选中未选择的软件包 nvidia-container-runtime。
准备解压 .../nvidia-container-runtime_3.4.2-1_amd64.deb  ...
正在解压 nvidia-container-runtime (3.4.2-1) ...
正在选中未选择的软件包 nvidia-docker2。
准备解压 .../nvidia-docker2_2.5.0-1_all.deb  ...
正在解压 nvidia-docker2 (2.5.0-1) ...
正在设置 libnvidia-container1:amd64 (1.3.3-1) ...
正在设置 libnvidia-container-tools (1.3.3-1) ...
正在设置 nvidia-container-toolkit (1.4.2-1) ...
正在设置 nvidia-container-runtime (3.4.2-1) ...
正在设置 nvidia-docker2 (2.5.0-1) ...
正在处理用于 libc-bin (2.31-0ubuntu9.2) 的触发器 ...
(base) xutengfei@xutengfei-G3-3579:~$ sudo systemctl restart docker
(base) xutengfei@xutengfei-G3-3579:~$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
Unable to find image 'nvidia/cuda:11.0-base' locally
 sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi^[[11.0-base: Pulling from nvidia/cuda
54ee1f796a1e: Pulling fs layer 
f7bfea53ad12: Pulling fs layer 
46d371e02073: Pulling fs layer 
b66c17bbf772: Waiting 
3642f1a6dfb3: Waiting 
e5ce55b8b4b9: Waiting 
155bc0332b0a: Waiting 
^C
(base) xutengfei@xutengfei-G3-3579:~$ docker run -itd --gpus all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all 5f0eb96d4de5
62cdf4d59ba3fd64f1362423f9ae03808b6ea941b0f798328a052658bc99f99d
(base) xutengfei@xutengfei-G3-3579:~$ docker commit -m="python for cv" -a="xutengfei" 62cdf4d59ba3fd64f1362423f9ae03808b6ea941b0f798328a052658bc99f99d python_cv:add-detectron2
sha256:649ba9b16fbbb2a492c58696187b9f1f653a08608818c3679c02371ea2777024
(base) xutengfei@xutengfei-G3-3579:~$ docker images
REPOSITORY                                                               TAG              IMAGE ID       CREATED         SIZE
python_cv                                                                add-detectron2   649ba9b16fbb   9 seconds ago   3.05GB
registry.cn-shenzhen.aliyuncs.com/xutengfei123/hand_for_reshensai        1.1              19e2a939983f   2 hours ago     3.63GB
registry.cn-shenzhen.aliyuncs.com/xutengfei123/hand_for_reshensai        1.0              f44389ec5e09   3 hours ago     3.53GB
<none>                                                                   <none>           1abba0409798   24 hours ago    3.94GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   1.0              cfea8d55bbf5   4 weeks ago     1.02GB
registry.cn-shanghai.aliyuncs.com/xutengfei123/test_for_tianchi_submit   <none>           8fcfbebff40a   4 weeks ago     1.02GB
python                                                                   3.8              4d53664a7025   4 weeks ago     883MB
(base) xutengfei@xutengfei-G3-3579:~$ cat /usr/local/cuda/version.txt
cat: /usr/local/cuda/version.txt: 没有那个文件或目录
(base) xutengfei@xutengfei-G3-3579:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
(base) xutengfei@xutengfei-G3-3579:~$ 


猜你喜欢

转载自blog.csdn.net/qq_44065334/article/details/114172545