1

Is there a way to use gifsicle in AWS lambda? I know there is a package called pygifsicle, but it seems it requires the gifsicle version of AWS Linux 2?

I don't see a binary built for RedHat version of gifsicle

So my questions are,

Do I need to build one for AWS Linux 2 to use it along with pygifsicle? Even if I build gifsicle for AWS Linux 2, how to use it along with pygifsicle?

Braiam
  • 1
  • 11
  • 47
  • 78
Jimson James
  • 2,937
  • 6
  • 43
  • 78

2 Answers2

1

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

subprocess.call(["gifsicle", *options, *sources, "--colors",
                str(colors), "--output", destination])
samtoddler
  • 8,463
  • 2
  • 26
  • 21
1

My Dockerfile where I'm building it from the source.

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"]
Osama Bin Saleem
  • 779
  • 1
  • 12
  • 24