1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +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 FROM alpine
MAINTAINER kev <noreply@easypi.pro> MAINTAINER kev <noreply@easypi.pro>
RUN set -xe \ RUN apk add --no-cache rsyslog
&& apk add --no-cache rsyslog \
&& sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ COPY rsyslog.conf /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
VOLUME /var/log VOLUME /var/log
WORKDIR /var/log WORKDIR /var/log

View File

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

View File

@ -5,16 +5,9 @@
FROM easypi/alpine-arm FROM easypi/alpine-arm
MAINTAINER EasyPi Software Foundation MAINTAINER EasyPi Software Foundation
RUN set -xe \ RUN apk add --no-cache rsyslog
&& apk add --no-cache rsyslog \
&& sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ COPY rsyslog.conf /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
VOLUME /var/log VOLUME /var/log
WORKDIR /var/log WORKDIR /var/log

View File

@ -4,5 +4,6 @@ rsyslog:
- "514:514/tcp" - "514:514/tcp"
- "514:514/udp" - "514:514/udp"
volumes: volumes:
- ./rsyslogd.conf:/etc/rsyslogd.conf
- ./data:/var/log - ./data:/var/log
restart: always 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/tcp"
- "514:514/udp" - "514:514/udp"
volumes: volumes:
- ./rsyslogd.conf:/etc/rsyslogd.conf
- ./data:/var/log - ./data:/var/log
restart: always 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")