How to start a privileged replica in swarm mode? #58

Closed
opened 2025-11-06 14:17:34 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @jeyrce on GitHub (Jul 22, 2022).

compose

version: "3.8"

services:
  udcp_collect:
    image: hub.deepin.com/xapi:pre-amd64
    privileged: true
    volumes:
      - /opt/udcp/udcp_collect/hardware_information/:/service/data/
      - /sbin/dmidecode:/sbin/dmidecode
      - /dev/mem:/dev/mem
    command:
      - "/service/api"
    logging:
      options:
        max-size: 10m
        max-file: 3

problem

The container were able to read the volume /dev/mem in docker-compose mode, but not worked in swarm mode like the follow log:

x_udcp-collect.1.9fh93hvhqa4m@uos-PC    | panic: failed to open stream: open /dev/mem: operation not permitted

Seems the privileged were not supported in swarm mode when stack deployed. So how to read special file like /dev/mem in swarm mode?

Originally created by @jeyrce on GitHub (Jul 22, 2022). ### compose ``` version: "3.8" services: udcp_collect: image: hub.deepin.com/xapi:pre-amd64 privileged: true volumes: - /opt/udcp/udcp_collect/hardware_information/:/service/data/ - /sbin/dmidecode:/sbin/dmidecode - /dev/mem:/dev/mem command: - "/service/api" logging: options: max-size: 10m max-file: 3 ``` ### problem The container were able to read the volume `/dev/mem` in docker-compose mode, but not worked in swarm mode like the follow log: ``` x_udcp-collect.1.9fh93hvhqa4m@uos-PC | panic: failed to open stream: open /dev/mem: operation not permitted ``` Seems the `privileged` were not supported in swarm mode when stack deployed. So how to read special file like `/dev/mem` in swarm mode?
Author
Owner

@jeyrce commented on GitHub (Aug 4, 2022):

Who can help?

@jeyrce commented on GitHub (Aug 4, 2022): Who can help?
Author
Owner

@mikesir87 commented on GitHub (Dec 22, 2022):

Hi @jeyrce! Apologies for the delay in responding to your question. Unfortunately, this repo's issue queue isn't intended to provide support or troubleshooting for deployment issues beyond the projects that are defined in this repo.

If you still need help, feel free to go to our other support channels (Docker Forums, Reddit, StackOverflow, etc.) to get additional assistance.

@mikesir87 commented on GitHub (Dec 22, 2022): Hi @jeyrce! Apologies for the delay in responding to your question. Unfortunately, this repo's issue queue isn't intended to provide support or troubleshooting for deployment issues beyond the projects that are defined in this repo. If you still need help, feel free to go to our other support channels (Docker Forums, Reddit, StackOverflow, etc.) to get additional assistance.
Author
Owner

@jeyrce commented on GitHub (Dec 23, 2022):

@mikesir87 Okay, thanks.

@jeyrce commented on GitHub (Dec 23, 2022): @mikesir87 Okay, thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-compose#58