• rapidocweb


    rapidocr
    
    id=$(buildah from --pull ubuntu:21.04)
    
    buildah run $id apt install --reinstall ca-certificates
    buildah run $id sed -e 's|^deb http://archive.ubuntu.com|deb http://mirrors.aliyun.com|g' -i.bak /etc/apt/sources.list
    buildah run $id apt update
    buildah run $id apt upgrade -y
    buildah config --env DEBIAN_FRONTEND=noninteractive $id
    buildah run $id apt install -y tzdata git gcc libgl1-mesa-glx vim wget  libglib2.0-0 
    buildah run $id wget https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-amd64-installer -O /tmp/s6-overlay-amd64-installer
    buildah run $id chmod +x /tmp/s6-overlay-amd64-installer 
    buildah run $id /tmp/s6-overlay-amd64-installer /
    buildah run $id wget https://github.com/just-containers/socklog-overlay/releases/download/v3.1.2-0/socklog-overlay-amd64.tar.gz -O /tmp/socklog-overlay-amd64.tar.gz
    buildah run $id tar xzf /tmp/socklog-overlay-amd64.tar.gz -C /
    buildah copy $id Miniconda3-py37_4.10.3-Linux-x86_64.sh /tmp/Miniconda3-py37_4.10.3-Linux-x86_64.sh
    buildah run $id chmod +x /tmp/Miniconda3-py37_4.10.3-Linux-x86_64.sh
    buildah run $id /tmp/Miniconda3-py37_4.10.3-Linux-x86_64.sh -b -p /miniconda
    buildah config --env PATH=/miniconda/bin:$PATH $id
    buildah run $id /miniconda/bin/conda install -y conda-build
    buildah run $id /miniconda/bin/conda clean -ya
    buildah config --env CONDA_AUTO_UPDATE_CONDA=false $id
    buildah run $id pip install opencv_python onnxruntime six pyclipper numpy Shapely Flask pillow gunicorn gevent -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
    buildah run $id mkdir /app
    buildah copy $id ocrweb /app
    buildah config --workingdir /app $id
    buildah config --port=80 $id
    buildah config --entrypoint='["/init"]' $id
    buildah config --cmd='python main.py'  $id
    buildah commit --format docker $id mydocker/rapidocr:20210822
    
    
    rapidocrmin
    
    #fedora 34 环境下编译
    
    ctr=$(buildah from scratch)
    mnt=$(buildah mount $ctr)
    dnf install --installroot $mnt --release 34 --setopt install_weak_deps=false --setopt=tsflags=nodocs -y bash coreutils mesa-libGL libstdc++ glib2
    /home/abc/Miniconda3-py37_4.10.3-Linux-x86_64.sh -b -p $mnt/miniconda
    cp /home/abc/ocrweb $mnt/app -r
    LD_LIBRARY_PATH=$mnt/usr/lib64 $mnt/miniconda/bin/pip install opencv_python  onnxruntime pyclipper  numpy  Shapely Flask  pillow  gunicorn gevent six utils -i https://pypi.tuna.tsinghua.edu.cn/simple/ --target=$mnt/miniconda/lib/python3.7/site-packages --no-cache-dir
    rm -rf $mnt/var/cache $mnt/var/log/*
    dnf clean --installroot $mnt all
    buildah unmount $ctr
    buildah config --env PATH=/miniconda/bin:$PATH $ctr
    buildah config --env CONDA_AUTO_UPDATE_CONDA=false $ctr
    buildah run $ctr pip install opencv_python  onnxruntime pyclipper  numpy  Shapely Flask  pillow  gunicorn gevent six utils -i https://pypi.tuna.tsinghua.edu.cn/simple/ --no-cache-dir
    buildah config --workingdir /app $ctr
    buildah config --port=80 $ctr
    buildah config --cmd='python main.py'  $ctr
    buildah commit --format docker $ctr test
    buildah push <image>:<tag> docker-archive:/home/abc/aaa.tar.gz
    gzip <image>_<tag>.tag
    gunzip -c <image>_<tag>.tar.gz | docker load
    
    
    
    来源于github url: https://github.com/RapidOCR/RapidOCR
  • 相关阅读:
    XML文件操作指南
    数字判断和文本框提交事件,WEB SERVICE等
    【转】JS回车提交
    nchar,char,varchar与nvarchar区别
    .NET对象的序列化
    这是发布的第一篇随笔
    Eclipse!!!!!!!!!!!!!!!!!!
    关于JLink驱动升级后不能使用的解决方法
    Python基本问题笔记
    用Python写的学校图书馆视频下载工具
  • 原文地址:https://www.cnblogs.com/yzpopulation/p/15183966.html
Copyright © 2020-2023  润新知