@@ -81,7 +81,7 @@ def update(ctx):
8181 "default_backend_datastore" : os .environ .get ('DEFAULT_BACKEND_DATASTORE' , 'datastore' ),
8282 "geonode_db_passwd" : os .environ .get ('GEONODE_DATABASE_PASSWORD' , 'geonode' ),
8383 "geonode_geodb" : os .environ .get ('GEONODE_GEODATABASE' , 'geonode_data' ),
84- "db_url" : os .environ .get ('DATABASE_URL' , 'postgres ://geonode:geonode@db:5432/geonode' ),
84+ "db_url" : os .environ .get ('DATABASE_URL' , 'postgis ://geonode:geonode@db:5432/geonode' ),
8585 "geodb_url" : os .environ .get ('GEODATABASE_URL' , 'postgis://geonode:geonode@db:5432/geonode_data' ),
8686 "geonode_db" : os .environ .get ('GEONODE_DATABASE' , 'geonode' ),
8787 "gs_loc" : os .environ .get ('GEOSERVER_LOCATION' , 'http://geoserver:8080/geoserver/' ),
@@ -297,10 +297,15 @@ def initialized(ctx):
297297 ctx .run ('date > /mnt/volumes/statics/geonode_init.lock' )
298298
299299def _docker_host_ip ():
300- client = docker .from_env ()
301- ip_list = client .containers .run (BOOTSTRAP_IMAGE_CHEIP ,
302- network_mode = 'host'
303- ).split ("\n " )
300+ try :
301+ client = docker .from_env (version = '1.24' )
302+ ip_list = client .containers .run (BOOTSTRAP_IMAGE_CHEIP ,
303+ network_mode = 'host'
304+ ).split ("\n " )
305+ except Exception :
306+ import traceback
307+ traceback .print_exc ()
308+ ip_list = ['127.0.0.1' , ]
304309 if len (ip_list ) > 1 :
305310 print ("Docker daemon is running on more than one \
306311 address {0}" .format (ip_list ))
@@ -314,24 +319,29 @@ def _docker_host_ip():
314319
315320
316321def _container_exposed_port (component , instname ):
317- client = docker .from_env ()
318- ports_dict = json .dumps (
319- [c .attrs ['Config' ]['ExposedPorts' ] for c in client .containers .list (
320- filters = {
321- 'label' : 'org.geonode.component={0}' .format (component ),
322- 'status' : 'running'
323- }
324- ) if '{0}' .format (instname ) in c .name ][0 ]
325- )
326- for key in json .loads (ports_dict ):
327- port = re .split ('/tcp' , key )[0 ]
322+ try :
323+ client = docker .from_env (version = '1.24' )
324+ ports_dict = json .dumps (
325+ [c .attrs ['Config' ]['ExposedPorts' ] for c in client .containers .list (
326+ filters = {
327+ 'label' : 'org.geonode.component={0}' .format (component ),
328+ 'status' : 'running'
329+ }
330+ ) if '{0}' .format (instname ) in c .name ][0 ]
331+ )
332+ for key in json .loads (ports_dict ):
333+ port = re .split ('/tcp' , key )[0 ]
334+ except Exception :
335+ import traceback
336+ traceback .print_exc ()
337+ port = '80'
328338 return port
329339
330340def _update_db_connstring ():
331341 user = os .getenv ('GEONODE_DATABASE' , 'geonode' )
332342 pwd = os .getenv ('GEONODE_DATABASE_PASSWORD' , 'geonode' )
333343 dbname = os .getenv ('GEONODE_DATABASE' , 'geonode' )
334- connstr = 'postgres ://{0}:{1}@db:5432/{2}' .format (
344+ connstr = 'postgis ://{0}:{1}@db:5432/{2}' .format (
335345 user ,
336346 pwd ,
337347 dbname
0 commit comments