P
P
Pavel Bezrukov2015-06-19 20:08:05
linux
Pavel Bezrukov, 2015-06-19 20:08:05

How and what utility should I run upstart and|or systemd in a docker container?

Good afternoon.
The question is not specific to docker containers, so I tagged linux and ubuntu.
After rebooting or starting the lxc container, all environment services, sshd, nginx, etc. are started.
But if you go into the docker container, then only 2-3 utilities are visible in htop.
Before I had no tasks to deal with bootloaders in Linux, and even now there is no direct goal to go deep, unless necessary.
So I ask the community to guide me. What do I need to run / install in the container at the start so that it starts all services like a normal virtual machine?
I read about upstart and systemd, it seems like the 2nd one is newer, but in practice, both should probably work, but I probably need to install and run them?
I know people write run scripts that are specific to docker, but in my opinion it gives crutches, is there any reason to use this technique or are cyclists just divorced?
Kernel 3.13, ubuntu 14.04

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2015-06-19
@bezrukovPS

Take https://github.com/phusion/baseimage-docker - you will have a patched init system for docker, and much more, the documentation is there.
In general, it is ideal to run one application in one container, and store data in a data-only container.
I started using Docker, and it turned out to be an analogue of a bunch of virtual machines that you get tired of updating.
As a result, I wrote this thing for repeatability and fast automatic backups / restores / updates: https://github.com/nazar-pc/docker-webserver
This is for my task, you probably have a different task, but the approach may be similar.
Set simplicity and repeatability as the main requirement - and over time you will come to the conclusion that a full-fledged OS in a container is not needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question