Mbed forum

File permissions with yotta Docker image

(Alan Bowman) #1

I have installed yotta in a Docker container, following the instructions at https://docs.mbed.com/docs/getting-started-mbed-os/en/latest/docker_install/. It seems to work as expected except for one point - when the project is created, all files and directories are created as root, so I need to use sudo to access anything. Is there some configuration I can use to get the files created with normal user permissions?

I am running Ubuntu 15.10, Docker 1.9.1 and am a member of the docker group so I can run it as a normal user.

(Rob Moran) #2

Hi Alan,

Thanks for bringing this issue to our attention. We will investigate a fix and get back to you shortly.

Kind regards,


(Rob Moran) #3

Hi Alan,

the script referenced in the documentation has been updated to address the problem you encountered. Would you mind giving it a try?

Kind regards,


(Alan Bowman) #4

That looks better - files are being created with the permissions of the current user. I tried running “yotta.sh build” on a project created before the change and got this message - is it related to the change made?:

info: generate for target: st-nucleo-f401re-gcc 0.2.1 at /yotta_home/work/blinky/yotta_targets/st-nucleo-f401re-gcc CMake Error: The current CMakeCache.txt directory /yotta_home/work/blinky/build/st-nucleo-f401re-gcc/CMakeCache.txt is different than the directory /yotta/blinky/build/st-nucleo-f401re-gcc where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt error: command ['cmake', '-D', 'CMAKE_BUILD_TYPE=RelWithDebInfo', '-G', 'Ninja', '.'] failed

(Rob Moran) #5

This is quite likely due to the change as different files will now have different owners.

If possible, I recommend you recreate your project with the new script.

Kind regards,


(Alan Bowman) #6

On line 7 in the new version of the script, I see that YT_HOME is set to /yotta_home. If this was instead set to /yotta, would this not make the old/new structures the same?

Apologies for not trying this before suggesting - I’m not at a PC I can test against.

(Rob Moran) #7

The cached build files remember the directory they were built in, so modifying the script for this case may fix the problem.

It may be better, however, to delete your build directory and build again allowing the cache to rebuild with the new folder.