cancel
Showing results for 
Search instead for 
Did you mean: 

How to install STM32CubeCLT in docker container?

cla
Associate II

Hello

I am new to this forum, so if I am at the wrong place, let me know.

How can this software: https://www.st.com/en/development-tools/stm32cubeclt.html be installed from a script? Namely into docker container?

I get the following error:

``` DISPLAY not set. Cannot display license. Aborting. ```

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Stefan1
Associate III

Try setting this env:

LICENSE_ALREADY_ACCEPTED=1

 

It works for STM32CubeIDE.

View solution in original post

7 REPLIES 7
Pavel A.
Evangelist III

What if you just install cubeclt on a normal linux machine with a display (yes, manually), then copy the stuff into container, post the result to your container server and be done with it?

 

Thanks for the suggestion. I will consider this.

I was wondering, though, if there is no way to do it automatically, as I would like to build the container automatically from a script as well. Is this really an edge-use-case? I would have thought, that the installer would provide a way to accept the license agreement from a script? I tried `echo y | install_script` and the like. It does not work.

If there is no way, where to post the feature request?

Thanks.

Pavel A.
Evangelist III

@SofLit could you look at this request? Is there a "legal" way to bypass the license annoyance for headless installation?

Hello @cla 

First let me thank you for posting.

In fact, during the installation it's required that the license agreement is done manually by the user.

I will raise your request internally and give you updates as soon as I get them.

KR,
Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Stefan1
Associate III

Try setting this env:

LICENSE_ALREADY_ACCEPTED=1

 

It works for STM32CubeIDE.

Final command:
```
unzip ./en.st-stm32cubeclt_1.16.0_xxxxx.sh.zip && \
chmod +x ./st-stm32cubeclt_1.16.0_xxxxx.sh && \
echo | sudo LICENSE_ALREADY_ACCEPTED=1 ./st-stm32cubeclt_1.16.0_xxxxx.sh
```

`echo` sends newline to accept default install directory (there might be a better approach, but this worked).

That's a good solution as well. Honestly, it's probably the cleaner solution.

I ended up just using an expect script to install on a devcontainer. Ensure you install procps-ng and expect before you run it if you do it this way. Then just remove the packages after it's installed. Here's the expect script.

#!/usr/bin/expect

# Path to your shell script
set script "/tmp/st-stm32cubeclt_1.17.0_23554_20241124_1810_amd64.sh"

# Start the script
spawn $script --nox11

# Automatically handle the --More-- paging prompt
expect {
-re "--More--" {
send "q"
exp_continue
}
-re {\[[NY]/[yn]\]}
{
send "y\n"
exp_continue
}
-re {STM32CubeCLT install dir\?}
{
send "/opt/st/stm32cubeclt_1.17.0\n"
exp_continue
}
}
# Wait for the script to finish
expect eof