crops / yocto-dockerfiles

This repository is for -base and -builder containers for building derivative containers (such as poky-container) for containerized Yocto Project builds.
GNU General Public License v2.0
145 stars 57 forks source link

is it possible to change uid of yoctouser? #105

Open mfide opened 3 months ago

mfide commented 3 months ago

I use following docker-compose.yml and it works fine on my debian12 system because by chance /home/mf/development folder in the host system owned by user mf and mf has UID:1000 which matches with yoctouser's UID in the container, therefore it has read/write access to the folder /home/yoctouser/development inside container.

services:
  yocto_builder:
    image: crops/yocto:ubuntu-22.04-base
    user: yoctouser
    container_name: yocto-builder
    hostname: yocto-builder
    command: ["sleep","infinity"]
    volumes:
      - /home/mf/development:/home/yoctouser/development
      - /home/mf/.ssh:/home/yoctouser/.ssh

But I have another system and my user name mfid with UID:1007 there. In this case, with the same docker compose file, I get Permission denied error inside container's development folder if I attempt to create a new file because yoctouser created in the container has UID:1000 which doesnt match with mfid's.

What is the suggested way to solve this problem?

Thank you.