You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried both with a MacOS system (M1 with Ventura 13) and a Linux (Intel x64 with Ubuntu 22).
I'm using Python 3.11 and GDAL 3.6 , so my Dockerfile is:
FROM ghcr.io/lambgeo/lambda-gdal:3.6 as gdal
# This example assume that you are creating a lambda package for python 3.11FROM public.ecr.aws/lambda/python:3.11
# Bring C libs from lambgeo/lambda-gdal imageCOPY --from=gdal /opt/lib/ /opt/lib/
COPY --from=gdal /opt/include/ /opt/include/
COPY --from=gdal /opt/share/ /opt/share/
COPY --from=gdal /opt/bin/ /opt/bin/
ENV \
GDAL_DATA=/opt/share/gdal \
PROJ_LIB=/opt/share/proj \
GDAL_CONFIG=/opt/bin/gdal-config \
GEOS_CONFIG=/opt/bin/geos-config \
PATH=/opt/bin:$PATH
ENV PACKAGE_PREFIX=/var/task
# Copy local filesCOPY handler.py ${PACKAGE_PREFIX}/handler.py
# install package# This example shows how to install GDAL python bindings for gdal 3.6# The GDAL version should be the same as the one provided by the `lambgeo/lambda-gdal` imageRUN python -m pip install GDAL==$(gdal-config --version) -t $PACKAGE_PREFIX
# Create package.zipRUN cd $PACKAGE_PREFIX && zip -r9q /tmp/package.zip *
Thank you in advance, let me know how I can help!
Edit: when commenting out that step, it also fails in the zipping step:
Building image…
Preparing build context archive…
[==================================================>]2/2 files
Done
Sending build context to Docker daemon…
[==================================================>] 620.0B
Done
Step 1/10 : FROM ghcr.io/lambgeo/lambda-gdal:3.6 as gdal
---> c5879094d40e
Step 2/10 : FROM public.ecr.aws/lambda/python:3.11
---> d4f123181098
Step 3/10 : COPY --from=gdal /opt/lib/ /opt/lib/
---> Using cache
---> bc97dcd894bf
Step 4/10 : COPY --from=gdal /opt/include/ /opt/include/
---> Using cache
---> 0875bf50e97b
Step 5/10 : COPY --from=gdal /opt/share/ /opt/share/
---> Using cache
---> 18ba81982b04
Step 6/10 : COPY --from=gdal /opt/bin/ /opt/bin/
---> Using cache
---> 9cdd27c76bed
Step 7/10 : ENV GDAL_DATA=/opt/share/gdal PROJ_LIB=/opt/share/proj GDAL_CONFIG=/opt/bin/gdal-config GEOS_CONFIG=/opt/bin/geos-config PATH=/opt/bin:$PATH
---> Using cache
---> 72fd2520b5e5
Step 8/10 : ENV PACKAGE_PREFIX=/var/task
---> Using cache
---> dc04248e2c05
Step 9/10 : COPY handler.py ${PACKAGE_PREFIX}/handler.py
---> Using cache
---> cf9879a5b079
Step 10/10 : RUN cd $PACKAGE_PREFIX && zip -r9q /tmp/package.zip *
---> Running in 039896078d67
/bin/sh: zip: command not found
Error response from daemon: The command '/bin/sh -c cd $PACKAGE_PREFIX && zip -r9q /tmp/package.zip *' returned a non-zero code: 127
The text was updated successfully, but these errors were encountered:
Same issue here. I had to add this: --platform=linux/amd64
Full docker file:
FROM --platform=linux/amd64 ghcr.io/lambgeo/lambda-gdal:3.6 as gdal
# This example assume that you are creating a lambda package for python 3.10
FROM --platform=linux/amd64 public.ecr.aws/lambda/python:3.11
# Bring C libs from lambgeo/lambda-gdal image
COPY --from=gdal /opt/lib/ /opt/lib/
COPY --from=gdal /opt/include/ /opt/include/
COPY --from=gdal /opt/share/ /opt/share/
COPY --from=gdal /opt/bin/ /opt/bin/
ENV \
GDAL_DATA=/opt/share/gdal \
PROJ_LIB=/opt/share/proj \
GDAL_CONFIG=/opt/bin/gdal-config \
GEOS_CONFIG=/opt/bin/geos-config \
PATH=/opt/bin:$PATH
ENV PACKAGE_PREFIX=/var/task
RUN yum clean all && yum -y update && yum -y install gcc gcc-c++ unzip curl zip
# Copy local files
COPY handler.py ${PACKAGE_PREFIX}/handler.py
# install package
# This example shows how to install GDAL python bindings for gdal 3.8
# The GDAL version should be the same as the one provided by the `lambgeo/lambda-gdal` image
RUN python -m pip install GDAL==$(gdal-config --version) -t $PACKAGE_PREFIX
# Create package.zip
RUN cd $PACKAGE_PREFIX && zip -r9q /tmp/package.zip *
Hello! Thank you for the project, it's really promising for my use case.
I'm trying the
Advanced
usage (https://github.com/lambgeo/docker-lambda?tab=readme-ov-file#2-advanced-need-other-dependencies) and I'm having the following error when building the image:I tried both with a MacOS system (M1 with Ventura 13) and a Linux (Intel x64 with Ubuntu 22).
I'm using Python 3.11 and GDAL 3.6 , so my Dockerfile is:
Thank you in advance, let me know how I can help!
Edit: when commenting out that step, it also fails in the zipping step:
The text was updated successfully, but these errors were encountered: