1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 18:06:36 +02:00

update rsyslog

This commit is contained in:
kev 2018-07-28 17:34:05 +08:00
parent 3821cfcb45
commit d90056efe5
7 changed files with 30 additions and 22 deletions

View File

@ -5,16 +5,9 @@
FROM alpine
MAINTAINER kev <noreply@easypi.pro>
RUN set -xe \
&& apk add --no-cache rsyslog \
&& sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \
&& { \
echo '###Syslog Server####'; \
echo 'module(load="imtcp")'; \
echo 'module(load="imudp")'; \
echo 'input(type="imtcp" port="514")'; \
echo 'input(type="imudp" port="514")'; \
} >> /etc/rsyslog.conf
RUN apk add --no-cache rsyslog
COPY rsyslog.conf /etc/rsyslog.conf
VOLUME /var/log
WORKDIR /var/log

View File

@ -12,6 +12,7 @@ rsyslog:
- "514:514/tcp"
- "514:514/udp"
volumes:
- ./rsyslog.conf:/etc/rsyslog.conf
- ./data:/var/log
restart: always
```
@ -24,8 +25,7 @@ $ docker-compose up -d
$ docker-compose exec rsyslog sh
>>> pwd
/var/log
>>> touch maillog
>>> tail -f /var/log/maillog
>>> tail -f /var/log/syslog
2016-10-29T08:17:34+00:00 172.17.0.1 root: hello
2016-10-29T08:17:41+00:00 172.17.0.1 root: world
^C

View File

@ -5,16 +5,9 @@
FROM easypi/alpine-arm
MAINTAINER EasyPi Software Foundation
RUN set -xe \
&& apk add --no-cache rsyslog \
&& sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \
&& { \
echo '###Syslog Server####'; \
echo 'module(load="imtcp")'; \
echo 'module(load="imudp")'; \
echo 'input(type="imtcp" port="514")'; \
echo 'input(type="imudp" port="514")'; \
} >> /etc/rsyslog.conf
RUN apk add --no-cache rsyslog
COPY rsyslog.conf /etc/rsyslog.conf
VOLUME /var/log
WORKDIR /var/log

View File

@ -4,5 +4,6 @@ rsyslog:
- "514:514/tcp"
- "514:514/udp"
volumes:
- ./rsyslogd.conf:/etc/rsyslogd.conf
- ./data:/var/log
restart: always

10
rsyslog/arm/rsyslog.conf Normal file
View File

@ -0,0 +1,10 @@
#### Modules ####
module(load="imudp") # UDP listener support
module(load="imtcp") # TCP listener support
#### LISTENERS ####
input(type="imudp" port="514")
input(type="imtcp" port="514")
#### OUTPUTS ####
*.* action(type="omfile" file="/var/log/syslog")

View File

@ -4,5 +4,6 @@ rsyslog:
- "514:514/tcp"
- "514:514/udp"
volumes:
- ./rsyslogd.conf:/etc/rsyslogd.conf
- ./data:/var/log
restart: always

10
rsyslog/rsyslog.conf Normal file
View File

@ -0,0 +1,10 @@
#### Modules ####
module(load="imudp") # UDP listener support
module(load="imtcp") # TCP listener support
#### LISTENERS ####
input(type="imudp" port="514")
input(type="imtcp" port="514")
#### OUTPUTS ####
*.* action(type="omfile" file="/var/log/syslog")