These container images contain all dependencies to compile an application for Ledger devices
The image is stored in the following directory:
legacy
contains all needed tools to compileC
andRust
applications. This image is quite heavy, but based on Ubuntu 22.04, so it is a good pick for tools using theglibc
, such asSonarQube
orCodeQL
.
To use or build these container images, first install Docker on you computer.
The images corresponding to the previous Dockerfiles are built and pushed on ghcr.io every time the SDK is updated. They can be pulled via these commands:
# pull the legacy image, built from `legacy/Dockerfile`
$ docker pull ghcr.io/karlsen-network/ledger-app-builder/ledger-app-builder-legacy:latest
The BOLOS_SDK
variable is used to specify the target SDK, allowing to compile the application for each Ledger device.
In the source folder of your application, you can compile with the following commands:
- For Nano S
$ sudo docker run --rm -ti -v "$(realpath .):/app" --user root ghcr.io/karlsen-network/ledger-app-builder/ledger-app-builder-legacy:latest
bash$ BOLOS_SDK=$NANOS_SDK make
- For Nano S+
$ sudo docker run --rm -ti -v "$(realpath .):/app" --user root ghcr.io/karlsen-network/ledger-app-builder/ledger-app-builder-legacy:latest
bash$ BOLOS_SDK=$NANOSP_SDK make
- For Stax
$ sudo docker run --rm -ti -v "$(realpath .):/app" --user root ghcr.io/karlsen-network/ledger-app-builder/ledger-app-builder-legacy:latest
bash$ BOLOS_SDK=$STAX_SDK make
The Docker images include the Clang Static Analyzer, which can be invoked with:
$ sudo docker run --rm -ti -v "$(realpath .):/app" --user root ghcr.io/karlsen-network/ledger-app-builder/ledger-app-builder-legacy:latest
bash$ BOLOS_SDK=$NANOS_SDK make scan-build
To load the app from the container, you will need additional docker arguments in order to allow Docker to access your USB port.
Your physical device must be connected, unlocked and the screen showing the dashboard (not inside an application). Same as for compilation, BOLOS_SDK
variable is used to specify the target device. Use the following docker command to load the app (here for Nano S device) :
$ sudo docker run --rm -ti -v "$(realpath .):/app" --privileged -v "/dev/bus/usb:/dev/bus/usb" --user root ghcr.io/karlsen-network/ledger-app-builder/ledger-app-builder-legacy:latest
bash$ BOLOS_SDK=$NANOS_SDK make load
If the provided images does not suit your needs or you want to tinker with them, you can build these images yourself.
Containers can be built using Docker
:
$ (cd full && sudo docker build -t ledger-app-builder-legacy:latest .)
Image can embed the Coverity Scan build tool. It is an excellent static analysis tool, and it can be very useful to find bugs in Nano apps.
The build tool must be downloaded before building the image. Archive can be downloaded from https://scan.coverity.com/download. Download is available to everyone, but it requires to create an account. After having registered, download Coverity Build Tool 2021.12 for Linux64 and place the downloaded archive in the coverity
directory.
Then, build container from the coverity/
directory with:
$ (cd full && sudo docker build -t ledger-app-scanner:latest .)