Groot icon indicating copy to clipboard operation
Groot copied to clipboard

Installing Groot and BehaviorTree.CPP in docker

Open AmitNativ1984 opened this issue 3 years ago • 3 comments

Hello, I had a problem building Groot with BehaviorTree.CPP inside docker. To solve it, I had to follow the specific instructions for building BehaviorTree.CPP. So if anyone might benefit from this... Here is the part from my Dockerfile to install both Groot and BehaviorTree.CPP

RUN git clone https://github.com/BehaviorTree/Groot.git &&\
    cd Groot &&\
    git submodule update --init --recursive &&\
    cd depend/BehaviorTree.CPP &&\
    mkdir build ; cd build &&\
    cmake .. &&\
    make &&\
    sudo make install &&\
    cd /root/Groot &&\
    mkdir build; cd build &&\
    cmake .. &&\
    make &&\
    # add alias for Groot GUI (simply type "Groot" in terminal)
    echo 'alias Groot="cd /root/Groot/build && ./Groot"' >> ~/.bashrc

AmitNativ1984 avatar Jun 26 '22 08:06 AmitNativ1984

Which error did you have? I also couldn't build from master so I checked out the branch that reverts https://github.com/BehaviorTree/Groot/pull/157 and it works

igricart avatar Jul 07 '22 12:07 igricart

What worked for me was:

Dockerfile:

FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y -q git build-essential cmake python3 libzmq3-dev qt5-default libqt5svg5-dev

RUN git clone https://github.com/BehaviorTree/Groot.git &&\
    cd Groot &&\
    git submodule update --init --recursive &&\
    cd depend/BehaviorTree.CPP &&\
    mkdir build ; cd build &&\
    cmake .. &&\
    make &&\
    make install &&\
    cd /Groot &&\
    mkdir build; cd build &&\
    cmake .. &&\
    make &&\
    # add alias for Groot GUI (simply type "Groot" in terminal)
    echo 'alias Groot="cd /Groot/build && ./Groot"' >> ~/.bashrc

# fixes: "error while loading shared libraries: libbehaviortree_cpp_v3.so: cannot open shared object"
RUN ldconfig

CMD cd /Groot/build && ./Groot

Compose

Of course requires mounting x11 as a volume:

  groot:
    container_name: groot
    build:
      context: ./path_to_folder_with_dockerfile
    environment:
      - DISPLAY
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix:rw

MrBlenny avatar Oct 18 '22 08:10 MrBlenny

Thank you. It works!

AmitNativ1984 avatar Oct 18 '22 11:10 AmitNativ1984