See opendatacube/geobase-builder instead
10K+
Please refer to opendatacube/geobase-builder for a new image and instructions on how to use.
Keeping text below for reference:
Repository is here: https://github.com/opendatacube/geobase
Set of docker images to build recent versions of geospatial libraries and python environments that use them.
requirements.txtrasterio[s3]
pyproj
DockerfileFROM opendatacube/geobase:wheels as env_builder
COPY requirements.txt /
RUN env-build-tool new /requirements.txt /env /wheels
FROM opendatacube/geobase:runner
COPY --from=env_builder /env /env
ENV LC_ALL=C.UTF-8
ENV PATH="/env/bin:${PATH}"
Basic idea is to use multi-stage builds to minimize output docker image size and to reduce surface area for security/deployment concerns.
Each step is described in more detail below. Overall structure is as following
base/builder, package GEOS and GDAL in .debbase/wheelsbase/runnerbuilder stage on opendatacube/geobase:wheelsapt-getopendatacube/geobase:runnerapt-getbuilder stagebuildack-deps:bionicFolder structure:
base/builder/Dockerfile base builder image: docker pull opendatacube/geobase:builder
/dl/ contains downloaded sources/opt/ contains built .deb for geos/gdal/proj6base/builder/gdal.opts feature selection for compiled GDAL, removing features should be easy, adding might require installing extra build dependencies with apt-get, might also need to add those extra libs to base/runner/Dockerfile.Next layer up from builder. Downloads and builds a collection of geospatial/numeric and related python wheels:
This layer is used a builder base in the multi-stage build.
Derives from ubuntu:18.04, has all the necessary C/C++/Fortran libs installed in non-dev mode to run python wheels from base/wheels.
It is used as base for "runner dockers" that use multi-stage building technique: builder stage constructs a python environment using pre-compiled wheels + whatever extra downloaded from pypi.
Mostly used as a development aid, useful for investigating compilation issues for new libs one would want to add.
local/Dockerfile build this locally with your USER and UIDopendatacube/geobose:wheels that runs by default with your user id and ads some data volumesTypical work flow:
./scripts/build-docker.sh
mkdir -p run
cd run
mkdir -p build dl envs
docker run \
-v $(pwd)/dl:/dl \
-v $(pwd)/build:/build \
-v $(pwd)/envs:/envs \
-ti --rm \
geobase:local
There is ./scripts/run-builder.sh that does just that.
Once inside you can build python wheels or whole environments, for example:
pip3 wheel --no-deps --no-binary :all: \
GDAL==$(gdal-config --version) \
pyproj \
Shapely \
fiona \
rasterio \
h5py
Content type
Image
Digest
Size
488.2 MB
Last updated
over 5 years ago
docker pull opendatacube/geobase:wheelsPulls:
30
Last week