Skip to content

mustafamizrak/docker-mapserver

 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 89.1%
  • Dockerfile 6.3%
  • Shell 4.6%