Skip to content

Commit 134380c

Browse files
authored
Add an entrypoint file for docker image
1 parent e526695 commit 134380c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docker-entrypoint.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
# Drop root privileges if we are running catalina
6+
# allow the container to be started with `--user`
7+
8+
if [ "$1" = 'catalina' -a "$(id -u)" = '0' ]; then
9+
10+
# Change the ownership to tomcat
11+
chown -R tomcat:tomcat ${CATALINA_HOME}/* && chown -R tomcat:tomcat /data
12+
shift
13+
exec su-exec tomcat /opt/tomcat/bin/catalina.sh "$@"
14+
else
15+
16+
# As argument is not related to catalina,
17+
# then assume that user wants to run his own process,
18+
# for example a `bash` shell to explore this image
19+
exec "$@"
20+
21+
fi

0 commit comments

Comments
 (0)