Hi Hanen,
This should work. Do you use any entry script to start the wso2 server?
This [1] is how we have done in WSO2 dockerfiles. If you replace the
mentioned line with the following line, it should work.
JAVA_OPTS="-DWSO2_ADMIN_USERNAME=${WSO2_ADMIN_USERNAME}
-DWSO2_ADMIN_PASSWORD=${WSO2_ADMIN_PASSWORD}"
${CARBON_HOME}/bin/wso2server.sh
I hope you correctly passed the environment variables as follows when
running the container. If you are using any cluster management system, you
need to provide values with relevant parameter values.
docker run -d -e WSO2_ADMIN_USERNAME=customuser -e
WSO2_ADMIN_PASSWORD=custompwd wso2esb:4.9.0
Another option is to start the wso2 server without JAVA_OPTS as follows.
${CARBON_HOME}/bin/wso2server.sh
-DWSO2_ADMIN_USERNAME=${WSO2_ADMIN_USERNAME}
-DWSO2_ADMIN_PASSWORD=${WSO2_ADMIN_PASSWORD}
[1] -
https://github.com/wso2/dockerfiles/blob/master/common/scripts/entrypoint.sh#L132
Thank you!
On Wed, Dec 14, 2016 at 7:58 PM, Hanen Ben Rhouma <[email protected]>
wrote:
> Hello,
>
> We're trying to launch WSO2 IS from a docker image by passing admin
> username and password as environment variables:
>
>
> JAVA_OPTS="-DWSO2_ADMIN_USERNAME=customuser -DWSO2_ADMIN_PASSWORD=custompwd"
> ./bin/wso2server.sh
>
>
> while WSO2_ADMIN_USERNAME and WSO2_ADMIN_PASSWORD are declared within
> user-mgt.xml as follow
>
> <AdminUser>
>
> 23
> <http://bitbucket.fpa.rbxd.ds/projects/LS/repos/wso2/browse/repository/conf/user-mgt.xml#23>
>
> <UserName>${WSO2_ADMIN_USERNAME}</UserName>
>
> 24
> <http://bitbucket.fpa.rbxd.ds/projects/LS/repos/wso2/browse/repository/conf/user-mgt.xml#24>
>
> <Password>${WSO2_ADMIN_PASSWORD}</Password>
>
> 25
> <http://bitbucket.fpa.rbxd.ds/projects/LS/repos/wso2/browse/repository/conf/user-mgt.xml#25>
>
> </AdminUser>
>
>
>
> We noticed that it's working locally but when we deploy in a centos VM
> containing docker, the variables aren't replcaed by their values.
>
>
> Any ideas why it's not picking up the arguments values?
>
>
>
> Regards,
>
> Hanen
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
*Pubudu Gunatilaka*
Committer and PMC Member - Apache Stratos
Software Engineer
WSO2, Inc.: http://wso2.com
mobile : +94774078049 <%2B94772207163>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev