1

I'm attempting to build several containers, each running service daemons like firewalld, ntpd, etc. I've read a lot about how using the --privileged flag basically negates the purpose of Docker containers and isn't secure. How do you run these services in a container without privileges? I'm attempting to use the centos:latest Docker image.

Thanks.

5
  • 1
    Running service daemons for what, the host? Why use Docker for that?
    – Daniel B
    Jun 21, 2021 at 10:42
  • @DanielB maybe those were bad examples, but I'm really just looking for a way to run services controlled by systemd inside containers. For instance, the httpd docker image runs httpd in a container without privs...How does it do that?
    – GreNIX
    Jun 21, 2021 at 11:09
  • 1
    …by not using Systemd? But maybe you don’t actually want to use Docker but instead magically containerize regular software installed on the host system?
    – Daniel B
    Jun 21, 2021 at 12:51
  • Interesting thing is that Centos supports systemd in container; see hub.docker.com/r/centos/systemd I think using systemd in docker is not so bad idea. Nov 18, 2021 at 3:39
  • firewalld is going to have to be able to access the packet filter, which is in kernel space, so that's going to have to run privileged. Sep 20, 2022 at 7:11

0

You must log in to answer this question.

Browse other questions tagged .