pdf2html 的docker使用方法和细节

Linux 安装pdf插件
https://www.icode9.com/content-3-223346.html
https://www.jianshu.com/p/bc5b41e6d0ac/

使用docker安装
https://zhuanlan.zhihu.com/p/33421982?from_voters_page=true

公司服务器

docker search pdf2htmlex
我选(klokoy/pdf2htmlex)
docker pull klokoy/pdf2htmlex
klokoy/pdf2htmlex 镜像大小 1.24G
运行,并且进入了容器
docker run -ti -v ~/zxxue2:/pdf klokoy/pdf2htmlex
这样zxxue2里面的文件,都会同步到容器的pdf文件中?
在容器中运行命令
pdf2htmlEX pdf/ocr.pdf 333.html

可以正常生成。生成位置

个人服务器
bwits/pdf2htmlex 镜像大小是246mb,卸载掉,换公司服务器一样的。

两行
docker run -it -v /www/wwwroot/106.53.210.133/pdf:/pdf klokoy/pdf2htmlex
pdf2htmlEX pdf/ocr.pdf pdf/ocr.html

一行
docker run -it -v /www/wwwroot/106.53.210.133/pdf:/pdf klokoy/pdf2htmlex pdf2htmlEX pdf/ocr.pdf pdf/ocr.html

卸载镜像
先停止,再卸载

www用户没有权限

 ls -l /var/run/docker.sock

将当前用户添加到docker组中,执行如下命令即可:

sudo usermod -a -G docker <用户名>

使用www 来安装docker

使用www来 docker pull 镜像

修改用户密码

[root@localhost testuser]# passwd testuser

如果不能修改密码,就百度一下。去掉限制,再修改。

给www用户root权限

下面是使用非root用户操作的步骤

创建docker组
sudo groupadd docker
将当前用户加入docker组

sudo gpasswd -a ${USER} docker
重新启动docker服务(下面是CentOS7的命令)

sudo service docker restart或sudo systemctl restart docker
当前用户退出系统重新登陆

su root

su franson 

运行docker命令
docker ps
原文地址:https://www.cnblogs.com/cn-oldboy/p/15457027.html