简体   繁体   中英

apk-get error-- command not found on aws lambda image

I am trying to build and upload my lambda container,but if fails on line RUN apt-get --command not found

I also tried with Run apk but it fails too with error --command not found

How can I install my package with public.ecr.aws/lambda/python:3.7 ?

FROM  public.ecr.aws/lambda/python:3.7

WORKDIR /code


COPY . .
COPY policy.xml /etc/ImageMagick-6

RUN pip install -r requirements.txt
RUN apt-get update && apt install -y tesseract-ocr-heb
RUN apt-get -y install ghostscript

EXPOSE 80
CMD ["app.lambda_handler"]

I also tried with

  1. Run apk but it fails too with error --command not found
  2. Run yum install -y tesseract-ocr-heb and got error-- One of the configured repositories failed (Unknown), #4 1.327 and yum doesn't have enough cached data to continue.

You should use yum package manager.

Here are the commands for installing tesseract on OpenSuse: https://tesseract-ocr.github.io/tessdoc/InstallationOpenSuse.html
add --nogpgcheck flag to skip key check.

Here is how your dockerfile should look like:

FROM public.ecr.aws/lambda/python:3.7

RUN yum install -y yum-utils

RUN yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/RHEL_7/
RUN yum update
RUN yum install -y tesseract --nogpgcheck
RUN yum install -y tesseract-langpack-heb --nogpgcheck



WORKDIR /code
COPY . .
COPY policy.xml /etc/ImageMagick-6
RUN yum install -y ghostscript


RUN pip install -r requirements.txt


EXPOSE 80
CMD ["app.lambda_handler"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM