first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
24
base/glassfish/4.1/Dockerfile
Normal file
24
base/glassfish/4.1/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM openjdk:8-jdk
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
ENV GLASSFISH_HOME /usr/local/glassfish4
|
||||
ENV PATH $PATH:$GLASSFISH_HOME/bin
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl unzip zip inotify-tools && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
curl -L -o /tmp/glassfish-4.1.zip http://download.java.net/glassfish/4.1/release/glassfish-4.1.zip && \
|
||||
unzip /tmp/glassfish-4.1.zip -d /usr/local && \
|
||||
rm -f /tmp/glassfish-4.1.zip
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
RUN set -ex \
|
||||
&& sed -i 's/address=9009/address=5005/' "${GLASSFISH_HOME}/glassfish/domains/domain1/config/domain.xml" \
|
||||
&& chmod +x /entrypoint.sh
|
||||
|
||||
WORKDIR /usr/local/glassfish4
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# verbose causes the process to remain in the foreground so that docker can track it
|
||||
CMD ["asadmin", "start-domain", "--debug=true", "--verbose"]
|
22
base/glassfish/4.1/docker-entrypoint.sh
Normal file
22
base/glassfish/4.1/docker-entrypoint.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||
#
|
||||
# Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
|
||||
set -ex
|
||||
|
||||
if [[ -z $ADMIN_PASSWORD ]]; then
|
||||
ADMIN_PASSWORD=$(date| md5sum | fold -w 8 | head -n 1)
|
||||
echo "##########GENERATED ADMIN PASSWORD: $ADMIN_PASSWORD ##########"
|
||||
fi
|
||||
|
||||
if [[ ! -e /glassfishpwd ]]; then
|
||||
echo "AS_ADMIN_PASSWORD=" > /glassfishpwd
|
||||
echo "AS_ADMIN_NEWPASSWORD=${ADMIN_PASSWORD}" >> /glassfishpwd
|
||||
asadmin --user=admin --passwordfile=/glassfishpwd --secure=false change-admin-password --domain_name domain1
|
||||
asadmin --secure=false start-domain
|
||||
echo "AS_ADMIN_PASSWORD=${ADMIN_PASSWORD}" > /glassfishpwd
|
||||
asadmin --user=admin --passwordfile=/glassfishpwd --secure=false enable-secure-admin
|
||||
asadmin --user=admin --passwordfile=/glassfishpwd --secure=false stop-domain
|
||||
fi
|
||||
|
||||
exec "$@"
|
Reference in New Issue
Block a user