Skip to content

Commit 0e7078e

Browse files
committed
Fixing in the runnable docker build
1 parent 7071aa2 commit 0e7078e

File tree

4 files changed

+39
-14
lines changed

4 files changed

+39
-14
lines changed

docker/javacommons-hazelcast/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ ENV CLUSTER_DISCOVERY "false"
5151
ENV CLUSTER_DNS_DISCOVERY_SERVICE "localhost"
5252
ENV CLUSTER_DNS_DISCOVERY_TIMEOUT 10
5353

54+
# Configurable Minimum / Maximum heap size to use
55+
#
56+
# Note that if this is not configured, its automatically infered
57+
# to be about 80% of the container ram limits.
58+
ENV MIN_HEAP_SIZE=""
59+
ENV MAX_HEAP_SIZE=""
60+
5461
# Custom entrypoint
5562
COPY jc-hazelcast-entrypoint.sh /jc-hazelcast-entrypoint.sh
5663
RUN chmod +x /jc-hazelcast-entrypoint.sh

docker/javacommons-hazelcast/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ ENV CLUSTER_DISCOVERY "false"
2323
ENV CLUSTER_DNS_DISCOVERY_SERVICE "localhost"
2424
ENV CLUSTER_DNS_DISCOVERY_TIMEOUT 10
2525
26+
# Configurable Minimum / Maximum heap size to use
27+
#
28+
# Note that if this is not configured, its automatically infered
29+
# to be about 80% of the container ram limits.
30+
ENV MIN_HEAP_SIZE=""
31+
ENV MAX_HEAP_SIZE=""
2632
```

docker/javacommons-hazelcast/hazelcast.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
77
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
88
xsi:schemaLocation="http://www.hazelcast.com/schema/config
9-
http://www.hazelcast.com/schema/config/hazelcast-config-4.1.xsd">
9+
http://www.hazelcast.com/schema/config/hazelcast-config-4.0.xsd">
1010
<!--
1111
Hazelcast cluster name support
1212
-->
@@ -36,6 +36,6 @@
3636
</join>
3737
</network>
3838

39-
<!-- Management center -->
40-
<management-center enabled="${hazelcast.mancenter.enabled}">${hazelcast.mancenter.url}</management-center>
39+
<!-- Management center (this config is dropped from 4.0 onwards, in favour on management center side config) -->
40+
<!-- <management-center enabled="${hazelcast.mancenter.enabled}">${hazelcast.mancenter.url}</management-center> -->
4141
</hazelcast>

docker/javacommons-hazelcast/jc-hazelcast-entrypoint.sh

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ JAVA_OPTS="-Dhazelcast.initial.min.cluster.size=${CLUSTER_INIT_MIN_SIZE} -Dhazel
1919
JAVA_OPTS="-Dhazelcast.rest.enabled=true -Dhazelcast.config=/hazelcast.xml ${JAVA_OPTS}"
2020

2121
# Add environment variable support (not needed in 3.12 onward? - need to confirm)
22-
JAVA_OPTS="-Denv.GROUP_NAME=${GROUP_NAME} ${JAVA_OPTS}"
22+
JAVA_OPTS="-Denv.CLUSTER_NAME=${CLUSTER_NAME} ${JAVA_OPTS}"
2323
JAVA_OPTS="-Denv.CLUSTER_INIT_MIN_SIZE=${CLUSTER_INIT_MIN_SIZE} ${JAVA_OPTS}"
2424
JAVA_OPTS="-Denv.CLUSTER_INIT_WAIT_TIME=${CLUSTER_INIT_WAIT_TIME} ${JAVA_OPTS}"
2525
JAVA_OPTS="-Denv.CLUSTER_MULTICAST=${CLUSTER_MULTICAST} ${JAVA_OPTS}"
@@ -38,20 +38,22 @@ echo "########################################"
3838
#
3939
# This copies over the original bash script, with minor modification
4040
#
41-
# from https://github.com/hazelcast/hazelcast-docker/blob/master/hazelcast-oss/start-hazelcast.sh
42-
# and https://github.com/hazelcast/hazelcast-docker/blob/8918f5114678e0ab37d38e3c6b656503142cf12f/hazelcast-oss/Dockerfile
41+
# from https://github.com/hazelcast/hazelcast-docker/blob/4.0.1/hazelcast-oss/start-hazelcast.sh
42+
# and https://github.com/hazelcast/hazelcast-docker/blob/4.0.1/hazelcast-oss/Dockerfile
4343
#
4444
# NOTE: At some point this needs to be changed when version bumping, to use the official script instead
4545
#
4646
#############################################################################################################################
4747

48-
# PS: This is moved to start of the script
49-
#-----------------------------------------
48+
# This is moved to start of the script (above)
49+
#--------------------------------------------------
5050
# set -euo pipefail
5151
#
5252
# eval JAVA_OPTS=\"${JAVA_OPTS}\"
5353
# eval CLASSPATH=\"${CLASSPATH}\"
5454

55+
# This is taken from the original
56+
#--------------------------------------------------
5557
if [ -n "${CLASSPATH}" ]; then
5658
export CLASSPATH="${CLASSPATH_DEFAULT}:${CLASSPATH}"
5759
else
@@ -64,6 +66,8 @@ else
6466
export JAVA_OPTS="${JAVA_OPTS_DEFAULT}"
6567
fi
6668

69+
# This is a custom implementation
70+
#--------------------------------------------------
6771
if [ -n "${MIN_HEAP_SIZE}" ]; then
6872
export JAVA_OPTS="-Xms${MIN_HEAP_SIZE} ${JAVA_OPTS}"
6973
fi
@@ -72,11 +76,16 @@ if [ -n "${MAX_HEAP_SIZE}" ]; then
7276
export JAVA_OPTS="-Xmx${MAX_HEAP_SIZE} ${JAVA_OPTS}"
7377
fi
7478

75-
if [ -n "${MANCENTER_URL}" ]; then
76-
export JAVA_OPTS="-Dhazelcast.mancenter.enabled=true -Dhazelcast.mancenter.url=${MANCENTER_URL} ${JAVA_OPTS}"
77-
else
78-
export JAVA_OPTS="-Dhazelcast.mancenter.enabled=false -Dhazelcast.mancenter.url=localhost ${JAVA_OPTS}"
79-
fi
79+
# NOTE: Mancenter config from the cluster was dropped in 4.0 onwards
80+
# in favour on management center side config
81+
# if [ -n "${MANCENTER_URL}" ]; then
82+
# export JAVA_OPTS="-Dhazelcast.mancenter.enabled=true -Dhazelcast.mancenter.url=${MANCENTER_URL} ${JAVA_OPTS}"
83+
# else
84+
# export JAVA_OPTS="-Dhazelcast.mancenter.enabled=false -Dhazelcast.mancenter.url=localhost ${JAVA_OPTS}"
85+
# fi
86+
87+
# This is removed from the original
88+
#--------------------------------------------------
8089

8190
# if [ -n "${PROMETHEUS_PORT}" ]; then
8291
# export JAVA_OPTS="-javaagent:${HZ_HOME}/lib/jmx_prometheus_javaagent.jar=${PROMETHEUS_PORT}:${PROMETHEUS_CONFIG} ${JAVA_OPTS}"
@@ -87,12 +96,15 @@ fi
8796
# sed -i "s/.level= INFO/.level= ${LOGGING_LEVEL}/g" logging.properties
8897
# fi
8998

99+
# Starting it up, as per the original script
100+
#--------------------------------------------------
101+
90102
echo "########################################"
91103
echo "# JAVA_OPTS=${JAVA_OPTS}"
92104
echo "# CLASSPATH=${CLASSPATH}"
93105
echo "# starting now...."
94106
echo "########################################"
95107
set -x
96-
exec java -server ${JAVA_OPTS} com.hazelcast.core.server.StartServer
108+
exec java -server ${JAVA_OPTS} com.hazelcast.core.server.HazelcastMemberStarter
97109

98110
#############################################################################################################################

0 commit comments

Comments
 (0)