- Clone this repository.
- Run
docker build --tag logger .
in root directory. - Run
docker run --detach --name=centos-systemd --mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup --mount type=bind,source=/sys/fs/fuse,target=/sys/fs/fuse --mount type=tmpfs,destination=/run --mount type=tmpfs,destination=/run/lock logger
.
- Run
docker pull axonny/logger
. - Run
docker run --detach --name=centos-systemd --mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup --mount type=bind,source=/sys/fs/fuse,target=/sys/fs/fuse --mount type=tmpfs,destination=/run --mount type=tmpfs,destination=/run/lock logger
.
You can just run the .sh
file, then logs from /var/log/fake_logs.log
will be read by default. You can also specify the path to the log file.
For example:
./count.sh log.txt
systemctl start fake-logger
starts the daemon.systemctl stop fake-logger
stops the daemon.systemctl restart fake-logger
restarts the daemon.
the service is started by default in the docker container.