代码之家  ›  专栏  ›  技术社区  ›  wobsoriano

如何在Dockerfile中将Ubuntu包/存储库转换为Alpine?

  •  0
  • wobsoriano  · 技术社区  · 5 年前

    目前我有这个 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
    

    我发现阿尔卑斯山的图片太大了。

    我被这件事缠住了

    FROM alpine
    
    RUN apk add --update ffmpeg cmake nodejs npm
    

    查看aline edge存储库,我似乎找不到 tesseract-ocr-all 不知道该怎么做 apt-get install -y software-properties-common && add-apt-repository -y ppa:alex-p/tesseract-ocr 在阿尔卑斯山。

    有什么资源可以帮我解决这个问题吗?我应该为这些软件包/存储库制作自己的阿尔卑斯山图像吗?

    0 回复  |  直到 4 年前
        1
  •  4
  •   Adiii    5 年前

    阿尔卑斯山包裹的名字是 tesseract-ocr ,你可以在这里查看 releases 还是阿尔卑斯山 repository .

    FROM alpine
    
    RUN apk add --update --no-cache ffmpeg cmake nodejs npm tesseract-ocr
    

    如果您对测试版感兴趣,可以查看 here .

    始终尝试添加 --no-cache 选项允许不在本地缓存索引,这会使容器变小。