-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-entrypoint.sh
executable file
·38 lines (32 loc) · 1.22 KB
/
docker-entrypoint.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
#!/bin/bash
set -e
if [ "$1" = 'kc.sh' ]; then
. /setenv.sh
chown -c keycloak:keycloak /opt/keycloak/data /opt/keycloak/themes
if [ ! -f /opt/keycloak/data/import/dcm4che-realm.json ]; then
cp -av /docker-entrypoint.d/data /opt/keycloak/
fi
if ! cmp -s /opt/keycloak/lib/quarkus/build-system.properties \
/docker-entrypoint.d/quarkus/build-system.properties; then
cp -av /docker-entrypoint.d/quarkus /opt/keycloak/lib
fi
if [ ! -f /opt/keycloak/themes/j4care/login/theme.properties ]; then
cp -av /docker-entrypoint.d/themes /opt/keycloak/
fi
if [ ! -f $JAVA_HOME/lib/security/cacerts.done ]; then
touch $JAVA_HOME/lib/security/cacerts.done
if [ "$EXTRA_CACERTS" ]; then
keytool -importkeystore \
-srckeystore $EXTRA_CACERTS -srcstorepass $EXTRA_CACERTS_PASSWORD \
-destkeystore $JAVA_HOME/lib/security/cacerts -deststorepass changeit
fi
fi
for c in $KEYCLOAK_WAIT_FOR; do
echo "Waiting for $c ..."
while ! nc -w 1 -z ${c/:/ }; do sleep 1; done
echo "done"
done
set -- chroot --userspec=keycloak:keycloak / "$@"
echo "Starting Keycloak $KEYCLOAK_VERSION"
fi
exec "$@"