MapProxy does have its own official docker images. These are currently hosted on the GitHub container registry and can be found here:
Currently we have 3 different images for every release, named e.g.
ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1
ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-dev
ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-nginx
The first one comes with everything installed, but no HTTP WebServer running. You can use it to implement your custom setup.
The second image, ending with -dev, starts the integrated webserver mapproxy provides through mapproxy-util serve-develop.
The third image, ending with -nginx, comes bundled with a preconfigured nginx HTTP Server, that lets you use MapProxy instantly in a production environment.
See the quickstart section below for a configuration / example on how to use those images.
There are also several inofficial Docker images available on Docker Hub that provide ready-to-use containers for MapProxy.
The community has very good experiences with the following ones:
There are also images available that already include binaries for MapServer or Mapnik:
Depending on your needs, pull the desired image (see description above):
docker pull ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1
or:
docker pull ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-dev
or:
docker pull ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-nginx
Create a directory (e.g. mapproxyconfig) for your configuration files. Put your configs into that folder. If you do not supply config files (seed.yaml and mapproxy.yaml) the image will create them for you.
To start the docker container with a mount on your config folder, use the command matching your image.
docker run --rm --name "mapproxy" -d -t -v `pwd`/mapproxyconfig:/mapproxy/config ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1
Afterwards, the MapProxy instance is idling and you can connect with the container via e.g.
docker exec -it mapproxy bash
docker run --rm --name "mapproxy" -p 8080:8080 -d -t -v `pwd`/mapproxyconfig:/mapproxy/config ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-dev
Afterwards, the MapProxy instance is running on http://localhost:8080/demo/
docker run --rm --name "mapproxy" -p 80:80 -d -t -v `pwd`/mapproxyconfig:/mapproxy/config ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-nginx
Afterwards, the MapProxy instance is running on http://localhost/mapproxy/demo/
There is currently one build argument you can use.
MAPPROXY_VERSION: Set the version you want to build.
Switch to the docker folder in the mapproxy repository checkout and then execute
docker build --build-arg MAPPROXY_VERSION=1.15.1 --target base -t ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1 .
docker build --build-arg MAPPROXY_VERSION=1.15.1 --target development -t ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-dev .
docker build --build-arg MAPPROXY_VERSION=1.15.1 --target nginx -t ghcr.io/mapproxy/mapproxy/mapproxy:1.15.1-nginx .