Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

533
Views
docker-compose device wildcard

I need to pass all video or audio or USB devices to a container.

devices:
  - "/dev/video*:/dev/video*"

This apparently doesn't work. But I the platform the container runs on, could have 2, 3 or more video sources and I need to pass all these into the docker container.

Anyone an idea, how to make this possible with docker-compose? I don't want to use 'priviledged' mode.

Thanks! Martin

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can map /dev to container, and add cgroups permission for the device.

If directly use docker command, see this

docker run -it --rm -v /dev:/dev --device-cgroup-rule='c *:* rmw' ubuntu:18.04 /bin/bash

You can change the first * in above command to major device number if you want to limit to some devices.

For compose, it seems just 2.3 can support this(I'm not sure why 3 not support, maybe need times), see this

version: "2.3"
services:
  backend:
     image: ubuntu:18.04
     device_cgroup_rules:
       - 'c *:* rmw'
     volumes:
       - /dev:/dev
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!