Skip to content

Instantly share code, notes, and snippets.

@atinfinity
Last active March 8, 2021 05:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atinfinity/c3255077e23164438c19544687e05b84 to your computer and use it in GitHub Desktop.
Save atinfinity/c3255077e23164438c19544687e05b84 to your computer and use it in GitHub Desktop.
depthai Dockerfile(does not work)
FROM ubuntu:18.04
# add new sudo user
ENV USERNAME depthai
ENV HOME /home/$USERNAME
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \
usermod --shell /bin/bash $USERNAME && \
usermod -aG sudo $USERNAME && \
mkdir /etc/sudoers.d && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
# Replace 1000 with your user/group id
usermod --uid 1000 $USERNAME && \
groupmod --gid 1000 $USERNAME
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
less \
emacs \
build-essential \
cmake \
git \
tmux \
bash-completion \
command-not-found \
software-properties-common \
xsel \
xdg-user-dirs \
wget \
curl \
usbutils \
udev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# https://github.com/luxonis/depthai-docker/blob/master/Dockerfile-depthai#L11
RUN echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | tee /etc/udev/rules.d/80-movidius.rules
USER $USERNAME
WORKDIR /home/${USERNAME}
SHELL ["/bin/bash", "-c"]
RUN sudo wget -qO- http://docs.luxonis.com/_static/install_dependencies.sh | bash
RUN git clone https://github.com/luxonis/depthai.git -b v0.4.0.0 && \
cd depthai && \
python3 install_requirements.py
@atinfinity
Copy link
Author

atinfinity commented Jan 4, 2021

Host

$ docker build -t depthai:0.4.0 .
$ docker run --privileged --rm -it --volume=/dev:/dev:rw --device-cgroup-rule='c 189:* rmw'  depthai:0.4.0 bash

Docker Container

$ python3
>>> import depthai
>>> device = depthai.Device('', False)
XLink initialized.
Sending internal device firmware
Failed to boot the device: 1-ma2480, err code 3
depthai: Error initializing xlink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment