[SAC] [OSGeo] #2438: Create a geos and postgis docker repo on repo.osgeo.org

OSGeo trac_osgeo at osgeo.org
Sun Apr 19 10:49:48 PDT 2020


#2438: Create a geos and postgis docker repo on repo.osgeo.org
---------------------------+------------------------
 Reporter:  robe           |       Owner:  sac@…
     Type:  task           |      Status:  new
 Priority:  normal         |   Milestone:  Unplanned
Component:  Systems Admin  |  Resolution:
 Keywords:                 |
---------------------------+------------------------

Comment (by robe):

 Okay I think I got this working.  I created a new docker.osgeo.org nginx
 config dedicated.  I could put it all in the nexus one, but felt might be
 better to keep it separate.  I'm planning to eventually take out all the
 /v2 stuff I put in on the nexus config.

 So the way it works, all pushes must go thru the project repo

 e.g  postgis-docker.osgeo.org, geoserver-docker.osgeo.org, geos-
 docker.osgeo.org

 But pulls go thru

 docker.osgeo.org

 To test I copied over strk's images:


 {{{
 docker pull docker.kbt.io/postgis/build-test:trisquel2
 docker tag docker.kbt.io/postgis/build-test:trisquel2 postgis-
 docker.osgeo.org/postgis/build-test:trisquel2
 docker push postgis-docker.osgeo.org/postgis/build-test:trisquel2

 }}}

 and that shows a new image in postgis-docker repository folder (and of
 course exposed in the docker group

 committed at -
 https://git.osgeo.org/gitea/sac/osgeo3/commit/87932245f05841f0413053e5f824dc0cd5bfae46

 So key area of nginx script looks like this sorry about the crappy
 indentation, going to fix that next


 {{{
  location ~ ^/(v1|v2)/[^/]+/?[^/]+/blobs/ {
            if ($request_method ~* (GET) ){
                         rewrite ^/(.*)$ /repository/docker/$1 last;
                 }
            if ($host = postgis-docker.osgeo.org ){
                 rewrite ^/(.*)$ /repository/postgis-docker/$1 last;
             }
           if ($host = geos-docker.osgeo.org ){
                 rewrite ^/(.*)$ /repository/geos-docker/$1 last;
           }
           if ($host = geoserver-docker.osgeo.org ) {
                 rewrite ^(.*)$ /repository/geoserver-docker/$1 last;
           }


             rewrite ^/(.*)$ /repository/docker/$1 last;
         }

       location ~ ^/(v1|v2)/ {
                 if ($request_method ~* (GET) ){
                         rewrite ^/(.*)$ /repository/docker/$1 last;
                 }
                 if ($host = postgis-docker.osgeo.org ) {
                         rewrite ^/(.*)$ /repository/postgis-docker/$1
 last;
                 }
                 if ($host = geos-docker.osgeo.org ) {
                         rewrite ^/(.*)$ /repository/geos-docker/$1 last;
                 }
                 if ($host = geoserver-docker.osgeo.org ) {
                         rewrite ^/(.*)$ /repository/geoserver-docker/$1
 last;
                 }

                 rewrite ^/(.*)$ /repository/docker/$1 last;
         }


     location / {
                 # First attempt to serve request as file, then
                 # as directory, then fall back to displaying a 404.
                 #try_files $uri $uri/ =404;
                 client_max_body_size 0;
                 include /etc/nginx/proxy_protocol_params;
                 #need to change this if using https on server and have a
 redirect
                 proxy_pass http://nexus.lxd:8081;
                 proxy_redirect off;
         }
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2438#comment:14>
OSGeo <https://osgeo.org/>
OSGeo committee and general foundation issue tracker.


More information about the Sac mailing list