mirror of
https://github.com/vimagick/dockerfiles.git
synced 2024-11-21 17:56:53 +02:00
update rsyslog
This commit is contained in:
parent
3821cfcb45
commit
d90056efe5
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
10
rsyslog/arm/rsyslog.conf
Normal 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")
|
@ -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
10
rsyslog/rsyslog.conf
Normal 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")
|
Loading…
Reference in New Issue
Block a user