From 1af92f0eab57aa3dabf7607e7f7f12cb21f25d12 Mon Sep 17 00:00:00 2001 From: Tim Sutton <tim@linfiniti.com> Date: Fri, 10 Oct 2014 22:55:06 +0800 Subject: [PATCH] In progress implementation for geoserver docker --- Dockerfile | 16 ++++++++++------ /dev/null | 5 ----- .gitignore | 3 ++- 71-apt-cacher-ng | 7 ++----- build.sh | 9 +++++++-- README.md | 4 ++-- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index fe25db9..51a5941 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -geoserver.zip +resources/geoserver.zip +.idea diff --git a/71-apt-cacher-ng b/71-apt-cacher-ng index 94d493e..12c66d3 100644 --- a/71-apt-cacher-ng +++ b/71-apt-cacher-ng @@ -1,5 +1,2 @@ -#Acquire::http { Proxy "http://192.168.1.80:3142"; }; -#Acquire::http { Proxy "http://192.168.0.104:3142"; }; -#Acquire::http { Proxy "http://192.168.2.3:3142"; }; -#Acquire::http { Proxy "http://192.168.1.13:3142"; }; -Acquire::http { Proxy "http://192.168.0.13:3142"; }; +Acquire::http { Proxy "http://192.168.2.9:3142"; }; +#Acquire::http { Proxy "http://192.168.0.13:3142"; }; diff --git a/Dockerfile b/Dockerfile index c884dfb..92f7a62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ #--------- Generic stuff all our Dockerfiles should start with so we get caching ------------ -FROM ubuntu:trusty +FROM consol/tomcat-8.0 MAINTAINER Tim Sutton<tim@linfiniti.com> RUN export DEBIAN_FRONTEND=noninteractive @@ -18,11 +18,15 @@ #-------------Application Specific Stuff ---------------------------------------------------- RUN apt-get -y install unzip openjdk-7-jre-headless openjdk-7-jre -ADD geoserver.zip /tmp/geoserver.zip -# Next three lines pilfered from -# https://ge.dec.wa.gov.au/_/dockers/dpaw_docker/geoserver/Dockerfile -#RUN wget http://downloads.sourceforge.net/project/geoserver/GeoServer/2.4.1/geoserver-2.4.1-bin.zip -O /tmp/geoserver.zip -RUN unzip /tmp/geoserver.zip -d /opt && mv -v /opt/geoserver* /opt/geoserver + +ADD resources /tmp/resources + +# A little logic that will fetch the geoserver zip file if it +# is not available locally in the resources dir and +RUN if [ ! -f /tmp/resources/geoserver/zip ]; then \ + wget -c http://downloads.sourceforge.net/project/geoserver/GeoServer/2.5.1/geoserver-2.5.1-bin.zip -O /tmpresources/geoserver.zip; \ + fi; \ + unzip /tmp/resources/geoserver.zip -d /opt && mv -v /opt/geoserver* /opt/geoserver ENV GEOSERVER_HOME /opt/geoserver ENTRYPOINT "/opt/geoserver/bin/startup.sh" diff --git a/README.md b/README.md index c75701f..f7e6373 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -docker-ssh -========== +Geoserver in Docker +=================== A simple docker container that runs tilemill (https://github.com/mapbox/tilemill). diff --git a/build.sh b/build.sh index 5a5d16f..424146e 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,7 @@ -#wget -c http://downloads.sourceforge.net/project/geoserver/GeoServer/2.4.1/geoserver-2.4.1-bin.zip -O geoserver.zip -docker.io build -t kartoza/geoserver . +#!/bin/sh + +if [ ! -f resources/geoserver.zip ] +then + wget -c http://downloads.sourceforge.net/project/geoserver/GeoServer/2.5.1/geoserver-2.5.1-bin.zip -O resources/geoserver.zip +fi +docker build -t kartoza/geoserver . diff --git a/run_tilemill.sh b/run_tilemill.sh deleted file mode 100755 index f61fe48..0000000 --- a/run_tilemill.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - - -# Set the locale - see http://jaredmarkell.com/docker-and-locales/ -# a work around for this error when running tilemill: -# what(): locale::facet::_S_create_c_locale name not valid -locale-gen en_US.UTF-8 -export LANG en_US.UTF-8 -export LANGUAGE en_US:en -export LC_ALL en_US.UTF-8 -TILEMILL_HOST=`ifconfig eth0 | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}'` -cd /usr/share/tilemill -./index.js --server=true --listenHost=0.0.0.0 --coreUrl=${TILEMILL_HOST}:20009 --tileUrl=${TILEMILL_HOST}:20008 diff --git a/setup_tilemill.rst b/setup_tilemill.rst deleted file mode 100644 index e4c2ff0..0000000 --- a/setup_tilemill.rst +++ /dev/null @@ -1,47 +0,0 @@ -How I set up tile stream in docker: -=================================== - -Starting the committed instance:: - - sudo docker run -d \ - -name="tilemill" \ - -p 2222:22 \ - -v /home/gisdata:/home/gisdata \ - -v /home/timlinux/Documents/MapBox:/Documents/MapBox \ - kartoza/tilemill \ - supervisord -n - -Under this scenario, we share our gisdata directory from /home/gisdata to -a similarly named directory in the docker container. We also share our -MapBox directory to /Documents/MapBox which is where the docker installed -tilemill will look for and store its docs. - -If you are using a linked container for postgis you might want to add the -link -option like this:: - - sudo docker run -d \ - -name="tilemill" \ - -p 2222:22 \ - -link postgis:pg \ - -v /home/gisdata:/home/gisdata \ - -v /home/timlinux/Documents/MapBox:/Documents/MapBox \ - kartoza/tilemill \ - supervisord -n - -With the ``-link`` option in place you can refer to the postgis database -host and port using these environment variables in your tilemill vm:: - - - -Connecting to the running instance with ssh port forwarding:: - -ssh localhost -p2222 -l root -L 20009:localhost:20009 -L 20008:localhost:20008 - - -Now open your browser at: http://localhost:20009 - -Killing the running instance:: - - sudo docker kill tilemill - sudo docker rm tilemill - diff --git a/tilemill.conf b/tilemill.conf deleted file mode 100644 index 0aa9eeb..0000000 --- a/tilemill.conf +++ /dev/null @@ -1,5 +0,0 @@ -[program:tilemill] -user=root -command=/run_tilemill.sh -autorestart=true -stopsignal=INT -- Gitblit v0.0.0-SNAPSHOT