目前我有这个Dockerfile
FROM ubuntu:18.04
# https://github.com/tesseract-shadow/tesseract-ocr-re
RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:alex-p/tesseract-ocr
RUN apt-get update && apt-get install -y tesseract-ocr-all
RUN apt-get install -y git build-essential cmake
RUN apt-get install -y ffmpeg
# Install Node and NPM
RUN apt-get install nodejs -y && apt-get install npm -y
图像的尺寸太大,所以我搜索了替代品并找到了关于 Alpine 的信息。我被这个困住了
FROM alpine
RUN apk add --update ffmpeg cmake nodejs npm
查看 aline 边缘存储库,我似乎找不到 tesseract-ocr-all
不知道该怎么做apt-get install -y software-properties-common && add-apt-repository -y ppa:alex-p/tesseract-ocr
在 Alpine 。有什么资源可以帮助我解决这个问题吗?我应该为这些包/存储库制作自己的 Alpine 镜像吗?
最佳答案
alpine 包名是 tesseract-ocr , 你可以在这里查看releases或 Alpine repository .
FROM alpine
RUN apk add --update --no-cache ffmpeg cmake nodejs npm tesseract-ocr
如果您对测试版感兴趣,可以查看here .
总是尝试添加
--no-cache
选项允许不在本地缓存索引,从而使容器保持较小。
关于docker - 如何在 Dockerfile 中将 Ubuntu 包/存储库转换为 Alpine?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57829747/