简体   繁体   English

如何在 AWS 中使用 gifsicle lambda

[英]How to use gifsicle in AWS lambda

Is there a way to use gifsicle in AWS lambda?有没有办法在 AWS lambda 中使用 gifsicle? I know there is a package called pygifsicle , but it seems it requires the gifsicle version of AWS Linux 2?我知道有一个 package 叫做pygifsicle ,但它似乎需要 AWS Linux 2 的 gifsicle 版本?

I don't see a binary built for RedHat version of gifsicle我没有看到为 RedHat 版本的gifsicle构建的二进制文件

So my questions are,所以我的问题是,

Do I need to build one for AWS Linux 2 to use it along with pygifsicle?我是否需要为 AWS Linux 2 构建一个以将其与 pygifsicle 一起使用? Even if I build gifsicle for AWS Linux 2, how to use it along with pygifsicle?即使我为 AWS Linux 2 构建 gifsicle,如何将它与 pygifsicle 一起使用?

As I read the documentation you can build one binary for Building Gifsicle on UNIX and can package that with your lambda zip file which can be called as a normal command in lambda function. As I read the documentation you can build one binary for Building Gifsicle on UNIX and can package that with your lambda zip file which can be called as a normal command in lambda function.

Like it is being called in the pygifsicle就像在pygifsicle中调用它一样

subprocess.call(["gifsicle", *options, *sources, "--colors",
                str(colors), "--output", destination])

My Dockerfile where I'm building it from the source.我的 Dockerfile 我正在从源代码构建它。

FROM public.ecr.aws/lambda/python:3.8-arm64

RUN yum -y install install make gcc wget gzip

RUN wget https://www.lcdf.org/gifsicle/gifsicle-1.93.tar.gz
RUN tar -xzf gifsicle-1.93.tar.gz
RUN cd gifsicle-1.93 && \
    ./configure && \
    make && \
    make install

COPY requirements.txt ./
RUN yum update -y && \
    pip install -r requirements.txt

COPY . .
CMD ["app.handler"]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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