[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Init systems and docker



Hi Debianistas!

Am 12.10.19 um 01:06 schrieb Ben Hutchings:
> On Fri, 2019-10-11 at 18:49 -0400, Scott Kitterman wrote:
>> I have had bugs filed against more than one package I maintain regarding issues 
>> with sysv init scripts when used in docker.
>>
>> I have been told by docker users (I'm not one) that systemd as provided on 
>> Debian can't be used in docker.  I have no idea if that's true or not.  I try 
>> really hard to know as little about init systems as possible and trust our 
>> maintainers who work on such things.
>>
>> If it is true, then to the extent we want Debian to be useful for docker does 
>> that mean we ought to maintain sysv init scripts?  If it's not true, can 
>> someone point me to documentation that explains using systemd on Debian in 
>> docker?
> [...]
> 
> As I understand it, Docker is meant for application containers, and
> application containers should have a trivial init process that directly
> launches a single application process.  No init script, or indeed any
> shell script, should be used at all.

I have to say that I disagree with you and many others on this thread.
Maybe Docker was *meant* for single application containers, I do not know.

However running a service ("a single application") often implies
surrounding services. F.ex. you want logs to be saved? Maybe you need to
run cron or at? Maybe you want to get notified about problems, stats,
whatever via email?

Now you can start re-implementing all the existing "surrounding" service
solutions on the outside of the container. Which is a *lot* of complex
work in my experience. The quick fix to those "surrounding" problems is
often enough to stand onto proven-to-work shoulders and to install the
"surrounding services" *inside* the container:

    apt-get install cron at rsyslogd etc. etc.

Now the next problem is how to start those. Easiest way is to hook the
provided Debian init scripts into whatever mini-init system one chooses.
And so forth.

So I imagine people that want to run stuff in containers are usually
very glad if init scripts are available, work and can be re-used.

John Goerzen is maintaining Debian docker images (thanks!) that contain
a useful set of the mentioned "surrounding" services, that are quite
popular AFAIK.

Being you, I'd ask for patches. I think running stuff in
Docker/Kubernetes is a good solution for a lot of problems. I think
Debian should grow to accommodate those architectures. And I think
Debian *will* accommodate them (see John's work and a lot of other nice
efforts in that direction not least by Ubuntu), it just takes time to
find the sweet spot solutions, to spread the knowledge and knowhow etc.
A lot of container loads are Debian based, not the least a lot of
Kubernetes' own people's.

This is my view of course, which *might* be herethic to the narrower
Docker and Kubernetes orthodoxies.


Reply to: