Docker: various updates

- use exec in entrypoint.sh, get rid of extra shell process
- use CMD instead of ENTRYPOINT, so image can be run with /bin/sh arg
This commit is contained in:
Zlatko Čalušić
2017-10-18 23:18:44 +02:00
parent 87356ac452
commit ebe3bc04b5
3 changed files with 27 additions and 27 deletions

19
docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
set -e
if [ -z "$DISABLE_AUTHENTICATION" ]; then
if [ ! -f "$PASSWORD_FILE" ]; then
touch "$PASSWORD_FILE"
fi
if [ ! -s "$PASSWORD_FILE" ]; then
echo
echo "**WARNING** No user exists, please 'docker exec -it \$CONTAINER_ID create_user'"
echo
fi
else
rm -f "$PASSWORD_FILE"
fi
exec rest-server --listen ":80" $OPTIONS --path "$DATA_DIRECTORY"