cancel
Showing results for 
Search instead for 
Did you mean: 

How to build headless inside a docker container

JAnde.15
Associate

I've installed STM32CubeIDE inside a docker ubuntu image.

If I start my docker-image and mount the folder with my source code (base directory is called 'primary' and hostmachine is a MacBook), and run this command:

/opt/st/stm32cubeide_1.10.1/stm32cubeide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data workspace -importAll primary -cleanBuild PrimarySTM32/Debug

The Project builds, compiles and links perfectly.

If I however, instead let Jenkins start the docker image, checkout the code from github and invoke the build commandline from within Jenkins, the linker stage fails with a lot of linker errors in the form of

2021.10.linux64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lLogging

'Logging' is one of the directories in my project. It is however present.

I've tried a bunch of things but I still get the same error. I don't understand the difference from running the build command directly in the docker-cli and having Jenkins run it...

Does anybody have an idea?

1 REPLY 1
Pavel A.
Evangelist III

So it looks like when the container runs on your machine, it mounts some directories which it cannot find under Jenkins. Try to understand where the stuff is mapped inside of the container, whether some environment variables should be set.... do you use the same container as Jenkins does?