Sign inSign up

jumanjiman/rsyslog

By jumanjiman

•Updated about 6 years ago

rsyslog in an alpine linux container

Image
12

1M+

jumanjiman/rsyslog repository overview

⁠rsyslog in a container

Build status: Circle CI

Project URL: https://github.com/jumanjihouse/docker-rsyslog⁠

Registry: https://registry.hub.docker.com/u/jumanjiman/rsyslog/⁠

⁠Overview

This source is used to build an image for rsyslog⁠. The image contains:

The runtime image is quite small (roughly 8 MB) since it is based on the alpine docker image⁠, which is based on Alpine Linux⁠.

I use this image in combination with logspout⁠ to forward log messages from containers to a central syslog server. If a particular docker container only logs to syslog, this rsyslog container provides a way to copy the log messages to docker logs, which gets picked up by logspout.

⁠How-to

⁠Fetch an already-built image

The runtime image is published as jumanjiman/rsyslog.

docker pull jumanjiman/rsyslog
⁠Run

Run a container from the CLI:

docker run -d \
  --name rsyslog.service \
  -h $(hostname) \
  jumanjiman/rsyslog

Run a container that only logs to syslog:

docker run -d \
  --name tftp \
  -h tftp.example.com \
  --volumes-from rsyslog.service \
  jumanjiman/tftp-hpa

Now you can tail the logs from the tftp container:

docker logs -f rsyslog.service
⁠Use systemd for automatic startup

Review and potentially modify the sample systemd unit file at systemd/rsyslog.service⁠, then run:

sudo cp systemd/rsyslog.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start rsyslog
sudo systemctl enable rsyslog
⁠Build

On a docker host, run:

script/build
script/test
⁠Publish to a private registry

You can push the built image to a private docker registry:

docker tag rsyslog registry_id/your_id/rsyslog
docker push registry_id/your_id/rsyslog

⁠Contribute

See CONTRIBUTING.md⁠ in this repo.

⁠Other rsyslog images

⁠License

See LICENSE⁠ in this repo.

Tag summary

Content type

Image

Digest

sha256:dfadcaeac…

Size

8.7 MB

Last updated

about 6 years ago

docker pull jumanjiman/rsyslog