Inject dynamic variable from backend java to freemarker template

I haven’t had a chance to update login.ftl to check, but I was able to extend the FreeMarkerLoginFOrmsProviderFactory and FreeMarkerLoginFormsProvider successfully.
I believe what you need is to add the file under resources\META-INF\service
org.keycloak.forms.login.LoginFormsProviderFactory
the contents are then the full classname of your factory.
FYI - I am using docker also, but did NOT change my spi-login-provider in the command line

If you get the source, you will see this is done in the testSuite - testsuite\integration-arquillian\servers\auth-server\services\testsuite-providers\src\main\resources\META-INF\services