Skip to content

Instantly share code, notes, and snippets.

@jduckles
Forked from perrygeo/Dockerfile
Created May 3, 2018 04:28
Show Gist options
  • Save jduckles/53720359a1639454cd27b37590ae0a7b to your computer and use it in GitHub Desktop.
Save jduckles/53720359a1639454cd27b37590ae0a7b to your computer and use it in GitHub Desktop.
Minimal debian image with Python 3.6 and geo python tools
FROM python:3.6-slim-stretch
ADD requirements.txt /tmp/requirements.txt
RUN apt-get update && \
apt-get install -y \
build-essential \
make \
gcc \
locales \
libgdal20 libgdal-dev && \
python -m pip install numpy cython --no-binary numpy,cython && \
python -m pip install \
"rasterio>=1.0a12" fiona shapely \
--pre --no-binary rasterio,fiona,shapely && \
python -m pip install -r /tmp/requirements.txt && \
python -m pip uninstall -y cython && \
rm -r /root/.cache/pip && \
apt-get remove -y --purge libgdal-dev make gcc build-essential && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
ENV LC_ALL C.UTF-8
CMD ["/bin/python"]
default: image test notebook
.PHONY: image shell
image:
docker build --tag slimpy:latest .
test:
docker run -it --rm slimpy:latest python -c "import rasterio, fiona, shapely, numpy, sys; print('Python:', sys.version); print('Rasterio:', rasterio.__version__); print('Fiona:', fiona.__version__); print('Shapely:', shapely.__version__); print('Numpy', numpy.__version__);"
shell: image
docker run -it --rm slimpy:latest /bin/bash
notebook:
docker run -it --rm \
-p 0.0.0.0:8888:8888 \
--rm \
--interactive \
--tty \
--volume $(shell pwd)/notebooks/:/notebooks \
slimpy:latest /bin/bash -c "cd /notebooks && jupyter notebook --ip=0.0.0.0 --allow-root"
rasterio>=1.0a12
fiona
shapely
pandas
geopandas
pyproj
mapbox
rasterstats
mapboxgl
jupyter
mercantile
scipy
scikit-learn
seaborn
statsmodels
ggplot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment