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 docker build instructions #252

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
26 changes: 26 additions & 0 deletions src/nrf52811/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,32 @@ The default SPI Slave pin configuration for nRF52811 is defined in `examples/pla

[spi-hdlc-adapter]: https://github.com/openthread/openthread/tree/main/tools/spi-hdlc-adapter

### Building using Docker

Alternatively, you can build using a Docker image instead of nRF Command Line Tools.

This can be useful in case of CI/CD builds or to build locally without installing the dependencies.

Example for building the firmware with UART support:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch ./script/build nrf52811 UART_trans -DOT_THREAD_VERSION=1.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuDuda @MarekPorwisz , are you OK with recommending use of this Docker image?

```

After a successful build, the `elf` files can be converted through the same container image.

For example:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex
```

See [Build NCS application firmware images using Docker][build-ncs-using-docker] for general instructions on using Docker to build an nRF Connect SDK based application.

[build-ncs-using-docker]: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/build-ncs-application-firmware-images-using-docker

### IEEE EUI-64 address

When the Thread device is configured to obtain the Thread Network security credentials with either Thread Commissioning or an out-of-band method, the extended MAC address should be constructed out of the globally unique IEEE EUI-64.
Expand Down
26 changes: 26 additions & 0 deletions src/nrf52833/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ After a successful build, the `elf` files can be found in `<path-to-ot-nrf528xx>
$ arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd ot-cli-ftd.hex
```

### Building using Docker

Alternatively, you can build using a Docker image instead of nRF Command Line Tools.

This can be useful in case of CI/CD builds or to build locally without installing the dependencies.

Example for building the firmware with USB CDC ACM support:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch ./script/build nrf52833 USB_trans -DOT_THREAD_VERSION=1.2
```

After a successful build, the `elf` files can be converted through the same container image.

For example:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex
```

See [Build NCS application firmware images using Docker][build-ncs-using-docker] for general instructions on using Docker to build an nRF Connect SDK based application.

[build-ncs-using-docker]: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/build-ncs-application-firmware-images-using-docker

### USB CDC ACM support

You can build the libraries with support for the native USB CDC ACM as a serial transport. To do so, build the firmware with the following parameter:
Expand Down
26 changes: 26 additions & 0 deletions src/nrf52840/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,32 @@ After a successful build, the `elf` files can be found in `<path-to-ot-nrf528xx>
$ arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd ot-cli-ftd.hex
```

### Building using Docker

Alternatively, you can build using a Docker image instead of nRF Command Line Tools.

This can be useful in case of CI/CD builds or to build locally without installing the dependencies.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is CI/CD in this case? Do the abbreviations need to be opened?

Are there downsides? For example, is the user foregoing all the support options (USB CDC ACM support, Bootloader support, and so on)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to say when building in a pipeline in the cloud, most of the time the build agent will run some generic OS and the build agent can be instructed to run our pipeline script in a specific container image.

In this case, building through the docker image can help better control the build environment over time and give better odds of a build not failing if the cloud provider updates the VM environment.

I don't know of any downsides but my tests were limited to the sample build I provided as an example in the PR description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, that sounds good and doesn't necessitate any more clarification, I think.


Example for the nRF52840 dongle:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB -DOT_THREAD_VERSION=1.2
```

After a successful build, the `elf` files can be converted through the same container image.

For example:

```bash
cd <path-to-ot-nrf528xx>
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workdir/project coderbyheart/fw-nrfconnect-nrf-docker:v1.8-branch arm-none-eabi-objcopy -O ihex build/bin/ot-rcp build/bin/ot-rcp.hex
```

See [Build NCS application firmware images using Docker][build-ncs-using-docker] for general instructions on using Docker to build an nRF Connect SDK based application.

[build-ncs-using-docker]: https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/build-ncs-application-firmware-images-using-docker

### USB CDC ACM support

You can build the libraries with support for the native USB CDC ACM as a serial transport. To do so, build the firmware with the following parameter:
Expand Down