How to install gifsicle in aws lambda using docker image

139 views Asked by At

this is my dockerfile:

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

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

COPY . .
CMD ["app.handler"]

I'm getting the following error:

#8 200.6 No package gifsicle available.
#8 200.7 Error: Nothing to do
1

There are 1 answers

0
Osama Bin Saleem On BEST ANSWER

I finally managed to do it by building the package from source. My 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"]