kartoza / docker-qgis-server

A dockerfile that contains a running QGIS server
68 stars 31 forks source link

I can't run docker-qgis-server container #1

Closed jancelin closed 9 years ago

jancelin commented 9 years ago

Sorry I'm a newsbee in docker but I can't run your docker-qgis-server container.

docker run --name "qgis-server" -p 2222:22 -p 8080:80 -d -t kartoza/docker-qgis-server
7109debdbfe9fa698df41c3e15584a496116a1325e539388a52b4e6b47d541aa
2014/08/27 17:21:54 Error: Cannot start container 7109debdbfe9fa698df41c3e15584a496116a1325e539388a52b4e6b47d541aa: port has already been allocated

and if I change port docker create a container but his statut is exited:

docker run --name "qgis-server" -p 2222:22 -p 8081:80 -d -t kartoza/docker-qgis-server
docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                     PORTS                    NAMES
75a6e3c0d7c6        kartoza/docker-qgis-server:latest   /bin/sh -c 'apachect   3 seconds ago       Exited (1) 2 seconds ago                            qgis-server  

For exemple I have docker ui and It works fine:

CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                     PORTS                    NAMES
75a6e3c0d7c6        kartoza/docker-qgis-server:latest   /bin/sh -c 'apachect   3 seconds ago       Exited (1) 2 seconds ago                            qgis-server         
5835fa3b861b        crosbymichael/dockerui:latest       ./dockerui -e /docke   7 weeks ago         Up 21 minutes              0.0.0.0:8001->9000/tcp   evil_brown 
timlinux commented 9 years ago

Hi @jancelin

Thanks for your issue report. There was an error in the Dockerfile. Can you do:

First get rid of old container and image

docker rm qgis-server
docker rmi docker-qgis-server

Rebuild the image (note the small name change):

docker build -t kartoza/qgis-server git://github.com/kartoza/qgis-server

Run the image:

docker run --name "qgis-server" -p 8081:80 -d -t kartoza/qgis-server

If you still have an issue starting it, please paste the output of docker logs qgis-server into this ticket.

timlinux commented 9 years ago

@jancelin also note that you should mount the web volume so a better way of running is

docker run --name "qgis-server" -v <path_to_local_qgis_project_folder>:/web -p 8081:80 -d -t kartoza/qgis-server

Replace with an absolute path on your filesystem. That folder should contain the .qgs project files you want to publish and all the data should be relative to the project files and within the mounted volume. See https://github.com/kartoza/maps.kartoza.com for an example of a project layout that we use to power http://maps.kartoza.com

timlinux commented 9 years ago

I have updated the README with above notes for those that follow.

jancelin commented 9 years ago

I look a error on the git address. It don't works with github.com/kartoza/qgis-server and look fine with github.com/kartoza/docker-qgis-server

docker build -t kartoza/qgis-server git://github.com/kartoza/qgis-server
2014/08/28 08:40:26 Error trying to use git: exit status 128 (fatal: remote error: 
  Repository not found.
Initialized empty Git repository in /tmp/docker-build-git760597994/.git/
)
 docker build -t kartoza/qgis-server git://github.com/kartoza/docker-qgis-server
Sending build context to Docker daemon 9.526 MB
Sending build context to Docker daemon 
...

Ah thanks - sorry I was too vigorous with my removal of ``docker-`` :-) Did you get everything working now?