2

Trying to access uEye Ethernet Camera from a Docker container, I successfully could access it from the host via the network but no luck from the container.

I am using docker-compose with privileged set to true as follow

version: '3'

services:

  #Engineering UI Service
  web:
    build:
     context: .
     dockerfile: Dockerfile
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    expose:
      - 8000
    networks:
      - backend
    container_name: web
    privileged: true
    cap_add:
      - SYS_ADMIN
    restart: always
    tty: true
networks:
  backend:
      driver: bridge

Dockerfile is set

FROM centos:7
# set environment varibles
USER root
ENV PYTHONUNBUFFERED 1

RUN yum -y update && yum -y install wget

# INSTALL CAMERA
RUN echo "Installing uEye camera" \
     && mkdir /uEye && cd /uEye \
     && wget http://test.com/uEye-Linux-4.90.06-64.tgz \
     && tar xvf uEye-Linux-4.90.06-64.tgz -C /uEye \
     && sh "ueyesdk-setup-4.90.06-eth-amd64.gz.run"

inside the container when running "/usr/local/share/ueye/bin/ueyesetid" I receive "No cameras connected !"

Nourdine
  • 67
  • 1
  • 9
  • Were you able to solve your problem? I have a similar situation but with a USB camera: https://stackoverflow.com/questions/60195652/how-can-i-run-a-service-inside-a-docker-container-to-get-feed-from-a-ids-ueye-ca – tgonzalez89 Feb 13 '20 at 01:06
  • 1
    Yes, the only way I could fix this is by setting cap-add=ALL and -v /dev:/dev. this is not recommended as it allows the container to have all the host privileges, but it's the only way I could get it to talk to the camera via Ethernet. – Nourdine Feb 25 '20 at 23:47

1 Answers1

0

The only way I could fix this is by setting cap-add=ALL and -v /dev:/dev. this is not recommended as it allows the container to have all the host privileges, but it's the only way I could get it to talk to the camera via Ethernet.

Nourdine
  • 67
  • 1
  • 9