forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_admin_server.sh
executable file
·54 lines (46 loc) · 2 KB
/
run_admin_server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
#
#Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
set_context() {
scriptDir="$( cd "$( dirname "$0" )" && pwd )"
if [ ! -d "${scriptDir}" ]; then
echo "Unable to determine the working directory for the domain home in image sample"
echo "Using shell /bin/sh to determine and found ${scriptDir}"
clean_and_exit
fi
echo "Context for docker build is ${scriptDir}"
}
set_context
. ${scriptDir}/container-scripts/setEnv.sh ${scriptDir}/properties/domain.properties
# HOST volume where the domain home will be persisted
domain_host_volume() {
domainhostvol=${DOMAIN_HOST_VOLUME}
if [ -z "$domainhostvol" ]; then
echo "The parameter DOMAIN_HOST_VOLUME must be set in ${scriptDir}/properties/domain.properties."
exit
else
if [ ! -d "$domainhostvol" ]; then
echo "Host volume $domainhostvol is an invalid directory, set DOMAIN_HOST_VOLUME in ${scriptDir}/properties/domain.properties to a valid host directory"
exit
fi
fi
echo "The domain configuration will get persisted in the host volume: $domainhostvol"
}
admin_host() {
adminhost=${ADMIN_HOST:-"AdminContainer"}
}
admin_listen_port() {
adminport=${ADMIN_LISTEN_PORT}
}
administration_port() {
administrationport=${ADMINISTRATION_PORT}
}
#echo "ENV_ARG is: ${ENV_ARG}"
admin_host
admin_listen_port
administration_port
domain_host_volume
echo "docker run -d -p 9001:${adminport} -p 9002:${administrationport} --name ${adminhost} --hostname ${adminhost} -v ${scriptDir}/properties:/u01/oracle/properties -v ${domainhostvol}:/u01/oracle/user_projects/domains ${ENV_ARG} 12213-weblogic-domain-in-volume"
docker run -d -p 9001:${adminport} -p 9002:${administrationport} --name ${adminhost} --hostname ${adminhost} -v ${scriptDir}/properties:/u01/oracle/properties -v ${domainhostvol}:/u01/oracle/user_projects/domains ${ENV_ARG} 12213-weblogic-domain-in-volume