Skip to content
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 new build file that creates docker container and builds the code #15

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ Open `cpp/demos/ossrf-nmos-api/config/nmos_config.json` and adjust the following
`./build/Debug/cpp/demos/ossrf-nmos-api/ossrf-nmos-api -f ./cpp/demos/ossrf-nmos-api/config/nmos_config.json`


## Build Container and Code simultaneously

./scripts/build-inside-container.sh
3 changes: 2 additions & 1 deletion images/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:22.04

# Versions
ENV CONAN_VERSION=2.4.0
ENV CMAKE_VERSION=3.27.0
ENV CMAKE_VERSION=3.28.4
ENV SSHD_PORT=55555


Expand All @@ -23,6 +23,7 @@ RUN /opt/bisect/scripts/build-tools/install-cmake-x86.sh
RUN apt-get install -y \
vim clang-format rsync gdb gdbserver x11-apps xauth iproute2 build-essential
RUN apt-get install -y libgtk-3-dev ninja-build
ENV PATH="/opt/cmake/bin:${PATH}"

RUN /opt/bisect/scripts/common/add-ssh-server.sh

Expand Down
26 changes: 26 additions & 0 deletions scripts/build-inside-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -eu

SCRIPT_DIR="$(realpath "$(dirname "$0")")"
PROJECT_DIR=${SCRIPT_DIR}/..

docker compose -f ${PROJECT_DIR}/images/docker-compose-x86-development.yml build
docker compose -f ${PROJECT_DIR}/images/docker-compose-x86-development.yml up -d

CONTAINER_NAME="images-ossrf-dev-1"

until docker exec -it $CONTAINER_NAME true > /dev/null 2>&1; do
echo "Waiting for container $CONTAINER_NAME to start..."
sleep 2
done

docker exec -it $CONTAINER_NAME bash -c "
git clone https://github.com/AMWA-TV/nmos-sender-receiver-framework.git
cd nmos-sender-receiver-framework
conan profile detect
./scripts/setup.sh
./scripts/build.sh
"

docker exec -it $CONTAINER_NAME fish -C "cd /home/nmos/nmos-sender-receiver-framework"