ubuntu上安装PaddleOCR环境(一)
一、安装docker
1.更新apt软件包索引并安装软件包以允许apt通过HTTPS使用存储库:
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
2.添加Docker的官方GPG密钥:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
3.使用以下命令来设置稳定的存储库。要添加 夜间或测试存储库,请在以下命令中的单词后面添加nightly或test(或两者)stable。
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
4.安装DOCKER引擎
更新apt程序包索引,并安装最新版本的Docker Engine和容器,或转到下一步以安装特定版本:
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
二、安装nvidia-docker2
1.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
2.curl -s -L https://nvidia.github.io/nvidia-container-runtime/experimental/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
3。nvidia-docker2更新软件包清单后,安装软件包(和依赖项):
sudo apt-get update
sudo apt-get install -y nvidia-docker2
4.设置默认运行时后,重新启动Docker守护程序以完成安装:
sudo systemctl restart docker