Skip to content

Dockerised btcpp_sample #3

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
git \
libzmq3-dev \
libsqlite3-dev \
libgtest-dev && \
rm -rf /var/lib/apt/lists/*

# Clone BehaviorTree.CPP for a source build
WORKDIR /usr/src/btcpp
RUN git clone https://github.com/BehaviorTree/BehaviorTree.CPP.git . --depth 1 --single-branch --branch 4.7.0

# Compile and install BehaviorTree.CPP
RUN mkdir build && \
cd build && \
cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON && \
make -j$(nproc) && \
make install

# Copy in btcpp_sample content.
WORKDIR /usr/src/
COPY ./ btcpp_sample
WORKDIR /usr/src/btcpp_sample

# Compile btcpp_sample Cmake project.
RUN mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc)
WORKDIR /usr/src/btcpp_sample/build

CMD ["./btcpp_sample"]