diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..8ff29f12 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +# Don't copy Dockerfile or git items +.gitignore +.git +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8ac9ae57 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Start from ubuntu +FROM ubuntu:17.04 + +# Update repos and install dependencies +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get -y install build-essential libsqlite3-dev zlib1g-dev + +# Create a directory and copy in all files +RUN mkdir -p /tmp/tippecanoe-src +WORKDIR /tmp/tippecanoe-src +COPY . /tmp/tippecanoe-src + +# Build tippecanoe +RUN make \ + && make install + +# Remove the temp directory and unneeded packages +WORKDIR / +RUN rm -rf /tmp/tippecanoe-src \ + && apt-get -y remove --purge build-essential && apt-get -y autoremove + +# Run the default command to show usage +CMD tippecanoe --help diff --git a/README.md b/README.md index 0d5745e9..1debe763 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,24 @@ You can concatenate multiple GeoJSON features or files together, and it will parse out the features and ignore whatever other objects it encounters. +Docker Image +------------ + +A tippecanoe Docker image can be built from source and executed as a task to +automatically install dependencies and allow tippecanoe to run on any system +supported by Docker. + +```docker +$ docker build -t tippecanoe:latest . +$ docker run -it --rm \ + -v /tiledata:/data \ + tippecanoe:latest \ + tippecanoe --output=/data/output.mbtiles /data/example.geojson +``` + +The commands above will build a Docker image from the source and compile the +latest version. The image supports all tippecanoe flags and options. + Options -------