-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate log and agent container (#426)
- Loading branch information
1 parent
be1f47c
commit e81bbf1
Showing
5 changed files
with
125 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
FROM alpine:3.18.2 | ||
|
||
ENV LOGROTATE_ROTATE=5 \ | ||
LOGROTATE_SIZE=100M \ | ||
TZ=Asia/Shanghai | ||
|
||
ARG TARGETARCH | ||
|
||
ADD hack/logrotate.sh /logrotate.sh | ||
RUN chmod +x /logrotate.sh | ||
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ | ||
&& echo $TZ > /etc/timezone \ | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
curl jq util-linux bash xfsprogs \ | ||
curl jq util-linux bash xfsprogs logrotate \ | ||
&& rm -rf /var/cache/apk/* |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/env bash | ||
|
||
ROTATE=5 | ||
SIZE=200M | ||
|
||
if [ -n "${LOGROTATE_ROTATE}" ]; then | ||
ROTATE=${LOGROTATE_ROTATE} | ||
fi | ||
|
||
if [ -n "${LOGROTATE_SIZE}" ]; then | ||
SIZE=${LOGROTATE_SIZE} | ||
fi | ||
|
||
nebula=" | ||
/usr/local/nebula/logs/*.log | ||
/usr/local/nebula/logs/*.impl | ||
/usr/local/nebula/logs/*.INFO | ||
/usr/local/nebula/logs/*.WARNING | ||
/usr/local/nebula/logs/*.ERROR | ||
{ | ||
su root root | ||
daily | ||
rotate ${ROTATE} | ||
copytruncate | ||
nocompress | ||
missingok | ||
notifempty | ||
create 644 root root | ||
size ${SIZE} | ||
} | ||
" | ||
|
||
echo "${nebula}" >/etc/logrotate.d/nebula |
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