forked from lambgeo/docker-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython
More file actions
47 lines (35 loc) · 1.2 KB
/
python
File metadata and controls
47 lines (35 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
ARG GDAL_VERSION_TAG=x
ARG RUNTIME_VERSION=x
FROM ghcr.io/lambgeo/lambda-gdal:${GDAL_VERSION_TAG} AS gdal
FROM public.ecr.aws/lambda/python:${RUNTIME_VERSION}
ARG PKG_INSTALLER
ARG NUMPY_VERSION
LABEL maintainer="lambgeo <geolambdas@gmail.com>"
ENV \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
CFLAGS="--std=c99"
RUN ${PKG_INSTALLER} install -y gcc gcc-c++ && \
${PKG_INSTALLER} clean all
RUN \
python -m pip install pip -U \
&& python -m pip install --upgrade setuptools \
&& python -m pip install cython numpy==${NUMPY_VERSION} wheel --no-binary numpy
# The PREFIX should be the same as in gdal{version}:latest
# When building rasterio, setup.py will get libs directoy from gdal-config
# $ gdal-config --libs
# -L/opt/lib -lgdal
ENV PREFIX=/opt
COPY --from=gdal /opt/lib/ $PREFIX/lib/
COPY --from=gdal /opt/include/ $PREFIX/include/
COPY --from=gdal /opt/share/ $PREFIX/share/
COPY --from=gdal /opt/bin/ $PREFIX/bin/
ENV \
GDAL_DATA=$PREFIX/share/gdal \
PROJ_LIB=$PREFIX/share/proj \
GDAL_CONFIG=$PREFIX/bin/gdal-config \
GEOS_CONFIG=$PREFIX/bin/geos-config \
PATH=$PREFIX/bin:$PATH
RUN export GDAL_VERSION=$(gdal-config --version)
RUN mkdir ${PREFIX}/python
ENTRYPOINT [ "bash" ]