-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: ensure ClickHouse init script is always executed
Recent versions of ClickHouse do not execute the provided entrypoint script when the database exists. Workaround this by using our own entrypoint and use it in place of the official one. See ClickHouse/ClickHouse#50724.
- Loading branch information
1 parent
1628c65
commit fa8dd62
Showing
5 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -ex | ||
set -e | ||
|
||
rm -f /tmp/init.sh | ||
while [ ! -s /tmp/init.sh ]; do | ||
sleep 1 | ||
wget --no-proxy -qO /tmp/init.sh http://akvorado-orchestrator:8080/api/v0/orchestrator/clickhouse/init.sh || continue | ||
done | ||
sh /tmp/init.sh | ||
if [[ $# -lt 1 ]] || [[ "$1" = "--"* ]]; then | ||
rm -f /tmp/init.sh | ||
while [[ ! -s /tmp/init.sh ]]; do | ||
sleep 1 | ||
echo "Downloading ClickHouse init script..." | ||
wget --no-proxy -qO /tmp/init.sh \ | ||
http://akvorado-orchestrator:8080/api/v0/orchestrator/clickhouse/init.sh || continue | ||
done | ||
sh /tmp/init.sh | ||
fi | ||
|
||
# Use official entrypoint | ||
exec /entrypoint.sh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters