Public | Automated Build

Last pushed: a year ago
Short Description
Latest mapcache build from sources under ubuntu 14.04
Full Description

What is mapcache ?

"MapCache is a server that implements tile caching to speed up access to WMS layers. The primary objectives are to be fast and easily deployable, while offering the essential features (and more!) expected from a tile caching solution."

Source :


How to use this image

Build mapcache docker image

This image is built under ubuntu 14.04.

$ git clone
$ cd mapcache-ubuntu14.04; mkdir data; mkdir data/maps; mkdir data/conf;  
$ docker build -t pamtrak06/mapcache-ubuntu14.04:latest .

Embedded wmts example from Data source : Environnement Canada, (licence)[]

Run mapcache docker container

Run container

$ cd mapcache-ubuntu14.04;
$ docker run --name [your container name] -d -t -p 8686:80 -v $(pwd)/data:/data pamtrak06/mapcache-ubuntu14.04 bash

Run container with link to mapserver container

$ cd mapcache-ubuntu14.04;
$ docker run --name [your container name] --link [your mapserver container name]:mapserver -d -t -p 8686:80 -v $(pwd)/data:/data pamtrak06/mapcache-ubuntu14.04 bash

Open a terminal session on a running container

$ docker ps
$ docker exec -d pamtrak06/mapcache-ubuntu14.04 /bin/bash

Exit container without stop it


Get docker vm ip frm windows or mac :

$ docker-machine env default
export DOCKER_HOST="tcp://"
export DOCKER_CERT_PATH="/Users/jp/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell: 
# eval "$(docker-machine env default)"

WMS GetCapabilities

http://<host ip>/mapcache/?service=wms&request=getCapabilities

WMTS GetCapabilities

http://<host ip>/mapcache/wmts/?service=wmts&request=getCapabilities


Take care about replacing time with syntaxe time=[actual year]-[actual month]-[actual day]T[hour]:00:00Z

Tips : Read available time in capabilities

http://<host ip>/mapcache/wmts/?service=WMTS&request=GetTile&format=image/png&width=1600&height=600&srs=EPSG:4326&layer=GDPS.ETA_P0_PRESSURE&TileMatrixSet=WGS84&TileMatrix=0&TileRow=0&TileCol=0&time=[time]

http://<host ip>/mapcache/wmts/?service=WMTS&request=GetTile&format=image/png&width=1600&height=600&srs=EPSG:4326&layer=GDPS.ETA_P0_PRESSURE&TileMatrixSet=WGS84&TileMatrix=0&TileRow=0&TileCol=1&time=[time]

Configure container

Mapcache configuration file could be fully modified or replaced.
Prerequisite : open a terminal session in the container.

$ vi /etc/apache2/conf-available/mapcache.xml

configure mapcache.xml with help from,
and then after modification restart apache server like

$ apachectl restart

Take care about mapcache cache strategy (with type="disk" all is stored in container)

Mapcache configuration file could be generate from script, arguments are :

$ cd /etc/apache2/conf-available/
$ ./ <wms url> <project name>

Example :

$ cd /etc/apache2/conf-available/
$  ./ geometca
$ ls -la mapcache.xml

Build a mapcache configuration from capabilities in javascript with help from

Example of parsing a WMS capabilities from WMS data source, (licence : environnement Canada) to build a mapcache.xml configuration file for Mapcache (tile WMTS server).

Connect to container :

$ docker exec -it $(docker ps | grep pamtrak06/mapcache-ubuntu14.04 | cut -d ' ' -f1 ) bash

Test http responses in the container :

$ ps -ef | grep apache
$ curl localhost
$ curl localhost/mapcache
$ curl localhost/mapcache/?service=wms&request=getCapabilities
$ curl localhost/mapcache/wmts/?service=wmts&request=getCapabilities
Docker Pull Command
Source Repository