Apparently ojdbc8, that I was using, is not compatible with Oracle 11g. I switched to ojdbc6 and it started working.
ojdbc8 (and for that matter even ojdbc17 also) work in development environment, from within IntelliJ, but fails in Docker.