-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made docker-gen being run once just before logrotate, fixed logrotate…
… config and moved some stuff to env vars
- Loading branch information
Showing
5 changed files
with
21 additions
and
21 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,14 +1,12 @@ | ||
{{ range $index, $value := $ }} | ||
/var/lib/docker/containers/{{ $value.ID }}/{{ $value.ID }}-json.log | ||
/var/lib/docker/containers/{{ $value.ID }}/{{ $value.ID }}-json.log{{ end }} | ||
{ | ||
daily | ||
{{LOGROTATE_MODE}} | ||
missingok | ||
rotate 3 | ||
size 512M | ||
rotate {{LOGROTATE_ROTATE}} | ||
size {{LOGROTATE_SIZE}} | ||
compress | ||
notifempty | ||
# create 644 root root | ||
copy | ||
copytruncate | ||
} | ||
{{ end }} | ||
|
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,14 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# using sed to strip color codes from forego output | ||
#exec /usr/local/bin/forego start | sed -r "s:\x1B\[[0-9;]*[mK]::g" | ||
sed -e 's/{{LOGROTATE_MODE}}/'"$LOGROTATE_MODE"'/' \ | ||
-e 's/{{LOGROTATE_ROTATE}}/'"$LOGROTATE_ROTATE"'/' \ | ||
-e 's/{{LOGROTATE_SIZE}}/'"$LOGROTATE_SIZE"'/' \ | ||
/app/logrotate.tmpl > /root/logrotate.tmpl | ||
|
||
set -m | ||
exec /usr/local/bin/go-cron "$GOCRON_SCHEDULER" /etc/cron.daily/logrotate | ||
|
||
trap 'kill $(jobs -p)' EXIT | ||
trap "exit" CHLD | ||
|
||
/usr/local/bin/docker-gen -watch /app/logrotate.tmpl /etc/logrotate.d/docker & | ||
/usr/local/bin/go-cron "$GOCRON_SCHEDULER" /etc/cron.daily/logrotate & | ||
|
||
wait |