Secure admin must be enabled to access DAS remotely - Acess Glassfish admin console with docker

I am trying to deploy my web application to a glass fish that is on a docker container. When I access the Admin Console ([IP]: 4848), I can access the login page, but there is this error message, and I cannot log in:

Secure admin must be enabled for remote access to DAS.

So I find in another post that I need to add this line to the bin folder:

./asadmin start-domain
./asadmin change-admin-password
./asadmin enable-secure-admin
./asadmin stop-domain
./asadmin start-domain

But I can’t do this because my glass fish specimen is on the container.

For information, I run glassfish with:

sudo docker run -p 4848:4848 -p 8080:8080 -e GLASSFISH_PASS="password" -d glassfish
+4
source share
1

, - , dokerer Payara. ( Payara GlassFish, docker GlassFish)

, 2 : a tmpfile, () , pwdfile, .

tmpfile:

AS_ADMIN_PASSWORD=
AS_ADMIN_NEWPASSWORD=MyNewPassword

pwdfile :

AS_ADMIN_PASSWORD=MyNewPassword

asadmin, change-admin-password, .

( dockerfile, ):

ENV PAYARA_PATH /opt/payara41
ENV ADMIN_USER admin
ENV ADMIN_PASSWORD admin

# set credentials to admin/admin 

RUN echo 'AS_ADMIN_PASSWORD=\n\
AS_ADMIN_NEWPASSWORD='$ADMIN_PASSWORD'\n\
EOF\n'\
>> /opt/tmpfile

RUN echo 'AS_ADMIN_PASSWORD='$ADMIN_PASSWORD'\n\
EOF\n'\
>> /opt/pwdfile

RUN \
 $PAYARA_PATH/bin/asadmin start-domain && \
 $PAYARA_PATH/bin/asadmin --user $ADMIN_USER --passwordfile=/opt/tmpfile change-admin-password && \
 $PAYARA_PATH/bin/asadmin --user $ADMIN_USER --passwordfile=/opt/pwdfile enable-secure-admin && \
 $PAYARA_PATH/bin/asadmin restart-domain

# cleanup
RUN rm /opt/tmpfile
+3

Source: https://habr.com/ru/post/1672203/


All Articles