Installing GDAL in the image (RUN apt-get update && apt-get install -y gdal-bin ) did not resolve this.
To reproduce:
$ docker build -t gdalnetcore .
$ docker run -it gdalnetcore
Unhandled Exception: System.TypeInitializationException: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdal_wrap' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdal_wrap: cannot open shared object file: No such file or directory
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..cctor()
--- End of inner exception stack trace ---
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..ctor()
at OSGeo.GDAL.GdalPINVOKE..cctor()
--- End of inner exception stack trace ---
at OSGeo.GDAL.GdalPINVOKE.AllRegister()
at OSGeo.GDAL.Gdal.AllRegister()
at GdalNetCore.Program.Main(String[] args) in /src/Program.cs:line 13
Got a PInvoke error when running on Docker.
Installing GDAL in the image (RUN apt-get update && apt-get install -y gdal-bin ) did not resolve this.
To reproduce:
$ docker build -t gdalnetcore .
$ docker run -it gdalnetcore
Unhandled Exception: System.TypeInitializationException: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdal_wrap' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdal_wrap: cannot open shared object file: No such file or directory at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate) at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..cctor() --- End of inner exception stack trace --- at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper..ctor() at OSGeo.GDAL.GdalPINVOKE..cctor() --- End of inner exception stack trace --- at OSGeo.GDAL.GdalPINVOKE.AllRegister() at OSGeo.GDAL.Gdal.AllRegister() at GdalNetCore.Program.Main(String[] args) in /src/Program.cs:line 13