Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6025

How can systemd and systemctl be enabled and used in Ubuntu Docker containers? [closed]

$
0
0

Problem

How can systemd and systemctl be enabled and used in Ubuntu Docker containers? Why isn't systemd enabled by default in these containers, and why is it not considered a best practice in Docker?

Setup

I'm running Docker containers from the ubuntu:16.04 and ubuntu:16.10 images.

Tests

If I execute:

systemctl status ssh in the 16,04 container

the result is the error Failed to connect to bus: No such file or directory

In the 16.10 container the error is: bash: systemctl: command not found.

If I do which systemctl systemctl is found in the 16.04 container but not in the 16.10 container.

I have spotted that /lib/systemd exists.

I have tried installing systemd with:

apt-get install systemd libpam-systemd systemd-ui

Then which systemctl finds systemctl in 16.10

but systemctl status ssh still gives the error Failed to connect to bus: No such file or directory

Questions

Can someone provide a solution for enabling and using systemd in Ubuntu Docker containers?

I have failed to find any documentation on this topic for Ubuntu / Ubuntu Docker images, only information on the Ubuntu transition from Upstart to systemd.


Viewing all articles
Browse latest Browse all 6025

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>