Public | Automated Build

Last pushed: 3 months ago
Short Description
rsyslog in an alpine linux container
Full Description

rsyslog in a container

Build status:

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:

  • rsyslog-x86_64
  • default, minimal configuration that you can easily override

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.

Docker Pull Command
Owner
jumanjiman
Source Repository

Comments (0)