Score:0

Dockerd run as ServiceUnit alters /tmp access

cn flag

It's been my first success weeks developing Docker containers using dockerd along its plugins and recently i found out some problems after automating the daemon.

Tried to manipulate dockerd as a systemd unit which loads system-wide as root from /usr/lib/systemd/system/* but i'm suffering problem stated next;

  • I want to run docker-daemon.service and containerd under specific user "docker", but i'm unsure how to set scope/slice capabilities.
  • Don't know the functioning of Unit socket files or if it's actual unix-socket or file-descriptor or its actual file visibility isolation purpose.
  • Once daemon starts, X11 won't load again, neither does APT since the service daemon alters /tmp permissions in some way. i've set /tmp in rw,exec,suid without success.
  • I really don't quite completely follow up on Systemd security, so these options (LockPersonality, NoNewPrivileges, RestrictNamespaces, etc) are commented out.

    My sole interest is to understand if SYSCAPS or the previously cited safety operators on Service Units are capable of rendering the daemon and /tmp permissions usable.


    Here's my actual working files.

    docker-daemon.service
[Unit]
Description=Docker Daemon Service
Requires=docker-daemon.socket
ConditionUser=root

[Service]
Type=notify
Environment="DOCKER_TMPDIR=/tmp"
Environment="DOCKER_OPTS='--data-root /tmp/doc --dns 127.0.0.1 --log-level info --experimental -H unix://'"
#ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376 --containerd=/run/containerd/containerd.sock
Environment="PATH=/opt/boot/docker/:/sbin/:$PATH"
ExecStart=/opt/boot/docker/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
#LockPersonality=yes
#MemoryDenyWriteExecute=yes
#NoNewPrivileges=no
Restart=on-failure
#RestrictNamespaces=no
#SystemCallArchitectures=native
#SystemCallFilter=@system-service
TimeoutSec=20
RestartSec=5
UMask=0077
Slice=session.slice

[Install]
Also=docker-daemon.socket
WantedBy=default.target

docker-daemon.socket

[Unit]
Description=Dockerd Daemon socket
ConditionUser=root

[Socket]
Priority=6
Backlog=5
ListenStream=%t/docker/docker

[Install]
WantedBy=sockets.target
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.