-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3053 from robotology/docker_support
Added experimental docker image in CI and documentation
- Loading branch information
Showing
11 changed files
with
248 additions
and
6 deletions.
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,19 @@ | ||
name: Docker build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
|
||
docker: | ||
name: 'Docker Image' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Build Docker Image | ||
id: build_docker_image | ||
run: | | ||
cd docker | ||
docker build -t yarp:ubuntu22.04 . |
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
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,27 @@ | ||
/** | ||
\page yarp_docker Docker image for Yarp | ||
|
||
You can find the official Yarp docker image here: | ||
|
||
+ https://github.com/robotology/yarp/docker | ||
|
||
You can build it using the command: | ||
|
||
\verbatim | ||
cd yarp/docker | ||
docker build -t yarp:ubuntu22.04 . | ||
\endverbatim | ||
|
||
You can run the docker image using the command: | ||
|
||
\verbatim | ||
sudo docker run --rm -it --privileged --network host --pid host -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/hosts:/etc/hosts -e QT_X11_NO_MITSHM=1 yarp:ubuntu22.04 | ||
\endverbatim | ||
|
||
To use the graphics inside the docker images, remember to disable X permission with the following command: | ||
|
||
\verbatim | ||
sudo xhost + | ||
\endverbatim | ||
|
||
*/ |
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
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,162 @@ | ||
FROM ubuntu:22.04 | ||
LABEL maintainer="Marco Randazzo" | ||
|
||
# Non-interactive installation mode | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV DOCKER_UPDATED_ON=23_11_2023 | ||
|
||
# Install essentials | ||
RUN apt-get update && apt-get install -y apt-utils \ | ||
software-properties-common \ | ||
sudo \ | ||
psmisc \ | ||
lsb-release \ | ||
protobuf-compiler \ | ||
libatlas-base-dev \ | ||
tmux \ | ||
nano \ | ||
geany \ | ||
vim \ | ||
wget \ | ||
curl \ | ||
build-essential \ | ||
git gitk \ | ||
cmake \ | ||
cmake-curses-gui \ | ||
autoconf \ | ||
xserver-xorg-video-dummy \ | ||
xserver-xorg-legacy \ | ||
net-tools \ | ||
terminator \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
gnupg \ | ||
locales \ | ||
python3-setuptools \ | ||
python3-pip \ | ||
iproute2 \ | ||
python3-tornado \ | ||
lsof \ | ||
iftop \ | ||
iputils-ping \ | ||
gdb \ | ||
bash-completion \ | ||
btop \ | ||
mlocate | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install numpy bpytop | ||
|
||
RUN sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config | ||
COPY ./common/xorg.conf /etc/X11/xorg.conf | ||
|
||
# Install yarp dependencies | ||
RUN apt-get install -y libace-dev \ | ||
libsqlite3-dev \ | ||
libtinyxml-dev \ | ||
libedit-dev \ | ||
qtbase5-dev \ | ||
qtdeclarative5-dev \ | ||
qtmultimedia5-dev \ | ||
libqt5opengl5-dev \ | ||
libqcustomplot-dev \ | ||
libopencv-dev \ | ||
libeigen3-dev \ | ||
libgraphviz-dev \ | ||
libpng-dev \ | ||
libv4l-dev \ | ||
libavcodec-dev \ | ||
libavdevice-dev \ | ||
libavformat-dev \ | ||
libavutil-dev \ | ||
portaudio19-dev \ | ||
libsdl1.2-dev \ | ||
libopenni2-dev \ | ||
libftdi-dev \ | ||
libi2c-dev \ | ||
libjpeg-dev \ | ||
libpcl-dev \ | ||
libsoxr-dev \ | ||
libgstreamer1.0-dev \ | ||
libgstreamer-plugins-base1.0-dev | ||
|
||
# Install SWIG and bindings dependencies | ||
RUN apt-get install -qq -y swig \ | ||
mono-mcs \ | ||
liblua5.3-dev \ | ||
lua5.3 \ | ||
tcl-dev \ | ||
tk-dev \ | ||
python3-dev \ | ||
liboctave-dev \ | ||
ruby-dev \ | ||
ruby \ | ||
perl | ||
|
||
# Create user: user1 | ||
USER root | ||
RUN useradd -l -u 33334 -G sudo -md /home/user1 -s /bin/bash -p user1 user1 && \ | ||
# passwordless sudo for users in the 'sudo' group | ||
sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers | ||
|
||
# Set ENV | ||
USER user1 | ||
RUN mkdir /home/user1/robotology | ||
ENV robotology_install_user user1 | ||
ENV user1_home /home/$robotology_install_user | ||
ENV robotology_install_folder $user1_home/robotology | ||
|
||
# Build ycm | ||
USER $robotology_install_user | ||
WORKDIR $robotology_install_folder | ||
RUN git clone https://github.com/robotology/ycm.git -b master | ||
RUN cd ycm && mkdir build && cd build && \ | ||
cmake .. \ | ||
-DCMAKE_BUILD_TYPE=Release && \ | ||
make -j11 | ||
ENV YCM_DIR=/home/user1/robotology/ycm/build | ||
|
||
# Build YARP | ||
USER $robotology_install_user | ||
WORKDIR $robotology_install_folder | ||
RUN git clone https://github.com/robotology/yarp.git -b master | ||
RUN cd yarp && mkdir build && cd build && \ | ||
cmake .. \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DYARP_COMPILE_libYARP_math=ON \ | ||
-DYARP_COMPILE_GUIS=ON \ | ||
-DYARP_COMPILE_DEVICE_PLUGINS=ON \ | ||
-DYARP_COMPILE_ALL_FAKE_DEVICES=ON \ | ||
-DENABLE_yarpcar_mjpeg=ON \ | ||
-DENABLE_yarpcar_segmentationimage=ON \ | ||
-DENABLE_yarpcar_portmonitor=ON \ | ||
-DENABLE_yarppm_bottle_compression_zlib=ON \ | ||
-DENABLE_yarppm_depthimage_compression_zlib=ON \ | ||
-DENABLE_yarppm_image_compression_ffmpeg=ON \ | ||
-DENABLE_yarppm_depthimage_to_mono=ON \ | ||
-DENABLE_yarppm_depthimage_to_rgb=ON && \ | ||
make -j11 | ||
ENV YARP_ROOT=$robotology_install_folder/yarp | ||
ENV YARP_DIR=$robotology_install_folder/yarp/build | ||
|
||
# YARP bindings | ||
USER $robotology_install_user | ||
WORKDIR $robotology_install_folder | ||
RUN cd yarp && cd bindings && mkdir build && cd build && cmake .. -DCREATE_PYTHON=ON && make -j11 | ||
|
||
# Install YARP completion | ||
RUN sudo ln -s /usr/local/share/bash-completion/completions/yarp /usr/share/bash-completion/completions | ||
|
||
# Set environmental variables | ||
USER $robotology_install_user | ||
RUN echo "PS1='\[\e]0;\u \w\a\]\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \$ '" >> /home/$robotology_install_user/.bashrc | ||
ENV PATH=$PATH:$YARP_DIR/bin | ||
ENV DISPLAY=:1 | ||
ENV YARP_DATA_DIRS=$YARP_DIR/share/yarp | ||
ENV LD_LIBRARY_PATH=$robotology_install_folder/yarp/build/lib/yarp/ | ||
ENV YARP_COLORED_OUTPUT=1 | ||
ENV QT_X11_NO_MITSHM=1 | ||
ENV PYTHONPATH=$PYTHONPATH:/home/user1/robotology/yarp/bindings/build/lib/python3/ | ||
|
||
# Manage yarp port | ||
EXPOSE 10000/tcp 10000/udp |
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,23 @@ | ||
Section "Monitor" | ||
Identifier "Monitor0" | ||
HorizSync 28.0-80.0 | ||
VertRefresh 48.0-75.0 | ||
# https://arachnoid.com/modelines/ | ||
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz | ||
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync | ||
EndSection | ||
Section "Device" | ||
Identifier "Card0" | ||
Driver "dummy" | ||
VideoRam 256000 | ||
EndSection | ||
Section "Screen" | ||
DefaultDepth 24 | ||
Identifier "Screen0" | ||
Device "Card0" | ||
Monitor "Monitor0" | ||
SubSection "Display" | ||
Depth 24 | ||
Modes "1920x1080_60.00" | ||
EndSubSection | ||
EndSection |
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
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
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
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
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