After searching around, I'm still confused whether you can have a docker container running Ubuntu with a working init system (upstart) and syslog, or not.
I know docker containers are meant for running a single process and not a full OS, but my use case is testing a daemon on various linux distros, making sure the daemon starts, stops and restarts successfully on crashes, etc., with logging to syslog. So I'm trying to decide if I can use a docker container for this or maybe I would be better of with Vagrant.
Some resources I found are confusing:
Container cannot connect to Upstart docker/docker#1024
Because Docker replaces the default /sbin/init with its own, there's no way to run the Upstart init inside a Docker container.
Using Supervisor with Docker
Traditionally a Docker container runs a single process when it is launched, for example an Apache daemon or a SSH server daemon. Often though you want to run more than one process in a container. There are a number of ways you can achieve this ranging from using a simple Bash script as the value of your container’s
CMD
instruction to installing a process management tool.
So basically what I need at the end is to be able to run:
$ initctl start <daemon>
$ initctl stop <daemon>
of course after creating the necessary conf file at /etc/init/<daemon>.conf
, and see the logs with syslog
.