-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dockerfile and introduction in readme #198
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b421a88
add Dockerfile for event-driven, readme to explain how to build docke…
mikihiroikura 7b5c0d1
Merge branch 'master' into feat/add-docker
mikihiroikura b77dc47
delete typo
mikihiroikura f7f277b
Merge branch 'master' into feat/add-docker
mikihiroikura 918a7c7
minor change in docker.md
mikihiroikura 61cb46d
add dockerfile for ubuntu 22.04, information about hardware configura…
mikihiroikura File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# base image | ||
FROM ubuntu:focal | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG CODE_DIR=/usr/local/src | ||
|
||
#basic environment | ||
RUN apt update && apt install -y \ | ||
ca-certificates \ | ||
build-essential \ | ||
git \ | ||
cmake \ | ||
cmake-curses-gui \ | ||
libace-dev \ | ||
libassimp-dev \ | ||
libglew-dev \ | ||
libglfw3-dev \ | ||
libglm-dev \ | ||
libeigen3-dev | ||
|
||
# Suggested dependencies for YARP | ||
RUN apt update && apt install -y \ | ||
qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev \ | ||
qml-module-qtquick2 qml-module-qtquick-window2 \ | ||
qml-module-qtmultimedia qml-module-qtquick-dialogs \ | ||
qml-module-qtquick-controls qml-module-qt-labs-folderlistmodel \ | ||
qml-module-qt-labs-settings \ | ||
libqcustomplot-dev \ | ||
libgraphviz-dev \ | ||
libjpeg-dev \ | ||
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | ||
gstreamer1.0-plugins-base \ | ||
gstreamer1.0-plugins-good \ | ||
gstreamer1.0-plugins-bad \ | ||
gstreamer1.0-libav | ||
|
||
# Add metavision-sdk in sources.list | ||
RUN echo "deb [arch=amd64 trusted=yes] https://apt.prophesee.ai/dists/public/b4b3528d/ubuntu focal sdk" >> /etc/apt/sources.list &&\ | ||
apt update | ||
|
||
RUN apt install -y \ | ||
libcanberra-gtk-module \ | ||
mesa-utils \ | ||
ffmpeg \ | ||
libboost-program-options-dev \ | ||
libopencv-dev \ | ||
metavision-sdk | ||
|
||
# YCM | ||
ARG YCM_VERSION=v0.15.2 | ||
RUN cd $CODE_DIR && \ | ||
git clone --depth 1 --branch $YCM_VERSION https://github.com/robotology/ycm.git && \ | ||
cd ycm && \ | ||
mkdir build && cd build && \ | ||
cmake .. && \ | ||
make -j `nproc` install | ||
|
||
# YARP | ||
ARG YARP_VERSION=v3.8.0 | ||
RUN cd $CODE_DIR && \ | ||
git clone --depth 1 --branch $YARP_VERSION https://github.com/robotology/yarp.git &&\ | ||
cd yarp &&\ | ||
mkdir build && cd build &&\ | ||
cmake .. &&\ | ||
make -j `nproc` install | ||
|
||
EXPOSE 10000/tcp 10000/udp | ||
RUN yarp check | ||
|
||
|
||
# event-driven | ||
ARG ED_VERSION=master | ||
RUN cd $CODE_DIR &&\ | ||
git clone --depth 1 --branch $ED_VERSION https://github.com/robotology/event-driven.git &&\ | ||
cd event-driven &&\ | ||
mkdir build && cd build &&\ | ||
cmake .. &&\ | ||
make -j `nproc` install | ||
|
||
# Add User ID and Group ID | ||
ARG UNAME=testuser | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
RUN groupadd -g $GID -o $UNAME | ||
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME | ||
|
||
# Change user and working directory | ||
USER $UNAME | ||
WORKDIR /home/${UNAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## Setup docker environment | ||
### Check udev rules in your host environment | ||
``` | ||
ls /etc/udev/rules.d -alh | ||
|
||
# If you don't have `88-cyusb.rule` and `99-evkv2.rules` in this folder, | ||
# Add them with following commands | ||
# Otherwise, you can skip these commands | ||
sudo wget -P /etc/udev/rules.d https://raw.githubusercontent.com/prophesee-ai/openeb/main/hal_psee_plugins/resources/rules/88-cyusb.rules | ||
sudo wget -P /etc/udev/rules.d https://raw.githubusercontent.com/prophesee-ai/openeb/main/hal_psee_plugins/resources/rules/99-evkv2.rules | ||
|
||
# Reload udev rules in your host environment | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger | ||
``` | ||
|
||
### Build docker image | ||
``` | ||
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t event-driven:latest . | ||
``` | ||
- Input current User ID and Group ID into Docker environment | ||
|
||
### Run and enter docker container | ||
``` | ||
docker run -it --privileged --network host -v /tmp/.X11-unix/:/tmp/.X11-unix -v /dev/bus/usb:/dev/bus/usb -e DISPLAY=unix$DISPLAY --name event-driven event-driven:latest | ||
``` | ||
|
||
### Open X Server for docker environment | ||
``` | ||
xhost local:docker | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @mikihiroikura @arrenglover ! Just a curiosity, there is any reason you need to use Ubuntu 20.04 instead of a more modern distribution? We are discussing about dropping Ubuntu 20.04 support for apt dependencies in robotology/robotology-superbuild#1439, and I am afraid that the next YARP release will not support Ubuntu 20.04 with apt dependencies.