Building a custom project using NRF Docker image

Hi,

I'm trying to build my custom test project with the nRF Docker in accordance with https://github.com/NordicPlayground/nrf-docker.

I've started with this simple script for nRF asset_tracker_v2 project which pretty successfully yields the desirable file tst.hex locally:

docker run --name cont_tst -v ${PWD}:/workdir/project -w /workdir/nrf/applications/asset_tracker_v2 nordicplayground/nrfconnect-sdk:v2.4-branch west build -p always -b nrf9160dk_nrf9160_ns --build-dir /workdir/project/build
docker cp cont_tst:/workdir/project/build/zephyr/merged.hex ./tst.hex
docker rm cont_tst

The goal is to reproduce a similar script for my custom project, which folder is, let's say, my_tst_project, and which is already pushed into GitHub repo, let's say, github.com/.../my_tst_project (no need to clone it then).

So when I try this in the folder my_tst_project (mention https://github.com/NordicPlayground/nrf-docker#build-the-firmware) ...

docker run --name cont_tst -v ${PWD}:/workdir/project nordicplayground/nrfconnect-sdk:v2.4-branch west build -p always -b nrf5340dk_nrf5340_cpuapp --build-dir /workdir/project/build 
docker cp cont_tst:/workdir/project/build/zephyr/merged.hex ./tst.hex 
docker rm cont_tst 

... I get the following:

ERROR: source directory "." does not contain a CMakeLists.txt; is this really what you want to build? (Use -s SOURCE_DIR to specify the application source directory)
FATAL ERROR: refusing to proceed without --force due to above error
Error: Launched process exited with non-zero status: 1

It seems the west doesn't see my project at all. Can you help me to figure out how to bind my project with the nRF Docker.

A trick with the parent folder (https://github.com/NordicPlayground/nrf-docker/commit/2d89a82c2c83e277e786e9cc245cefe8f238368c) doesn't work either. It means if I execute this in the parent folder ...

docker run -v ${PWD}:/workdir/project nordicplayground/nrfconnect-sdk:v2.4-branch /bin/bash -c '\
        cd my_tst_project && \
        west init -l && \
        west update --narrow -o=--depth=1'

... I get:

Error: Launched process exited with non-zero status: 127
Error: Subprocess /usr/local/share/nrfutil/bin/nrfutil-toolchain-manager failed with unexpected exit code Some(127)

My environment: Win10 22H2, Docker with WSL2, nRF Connect 2.4.0.

Parents
  • Hi, all,

    I believe I've got a clue.

    We need to copy a local project into a docker beforhand with commands like:

    docker create --name cont_tst nordicplayground/nrfconnect-sdk:v2.4-branch
    docker cp . cont_tst:/workdir/project

    Then we can get it run like:

    docker run --name cont_tst -v ${PWD}:/workdir/project/my_test_project -w /workdir/project/my_test_project nordicplayground/nrfconnect-sdk:v2.4-branch west build -p always -b nrf5340dk_nrf5340_cpuapp --build-dir /workdir/project/my_test_project/build

    So this ticket can be closed, alas.

Reply
  • Hi, all,

    I believe I've got a clue.

    We need to copy a local project into a docker beforhand with commands like:

    docker create --name cont_tst nordicplayground/nrfconnect-sdk:v2.4-branch
    docker cp . cont_tst:/workdir/project

    Then we can get it run like:

    docker run --name cont_tst -v ${PWD}:/workdir/project/my_test_project -w /workdir/project/my_test_project nordicplayground/nrfconnect-sdk:v2.4-branch west build -p always -b nrf5340dk_nrf5340_cpuapp --build-dir /workdir/project/my_test_project/build

    So this ticket can be closed, alas.

Children
Related