guiuprado / docker-mapserver

Mapserver in Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mapserver

Docker container for Mapserver

build image

docker build -t mapserver .

start container

docker run -d -p 8182:80 -v `pwd`/map:/map mapserver

while the command is
docker run -d -p [exposed port]:[internal port] -v [your-path]:[container-path] mapserver

access container via http

When Docker is forwarded as localhost simply open the following URL:
http://localhost:8182/cgi-bin/mapserv

When if you have docker-machine in place check its IP with to following command and replace the localhost with it.
docker-machine ip

To make sure the url specified above works the web browser should give a response:
No query information to decode. QUERY_STRING is set, but empty.

A quick way to access the contents of your mapfile in a browser can be achived by:
http://localhost:8182/cgi-bin/mapserv?map=/map/generic.map&mode=browse&template=openlayers&layers=all

The displayed map should look like that:
Generic-Map Browse-Mode Screenshot

Replace generic.map with the name of your mapserver mapfile.

enter container via bash

To enter the container with a bash interface simple switch from daemon mode to interactive mode
docker run -it -v `pwd`/map:/map mapserver bash

There you'll see the mapped /map folder and can use the useful cli tool like

About

Mapserver in Docker


Languages

Language:HTML 89.2%Language:Dockerfile 6.3%Language:Shell 4.6%