OSGi still allows for accessing of environment variables using the standard Java API System.getenv
However, the more modular (and OSGi-y) way would be to have a application configuration service that your application interfaces with. The application configuration service would then handle the accessing of environment variables and allow your application to be portable and readily testable outside of Docker. This service can handle type conversion for things String to Integer (all environment variables are treated like strings). This enables your Java application to not have to do type-conversion all over the place.
Note: You'll need to clarify your question regarding json configuration. Docker injects Linux process environment variables that are simple key-value. Did you perhaps mean to indicate a specific JSON configuration type used to configure the Docker container that is used by a specific Docker container toolchain?