[Qbs] setup-android, no --system?

Richard Weickelt richard at weickelt.de
Fri May 15 14:49:53 CEST 2020


> Because this file will end up in some "home" directory, which might
> not be accessible to the end user (eg. custom UID, GID, home, ...)
> Having a system wide qbs conf is bullet-proof in that regard.
> So, yes i would prefer to run the above command, but with '--system'
> and no, you cannot simply move the generated user's conf into
> /etc/xdg/qbs, they don't use the same 'ini' namespace

Until we are able to run the Docker daemon as non-root user, I am using this
approach:

1. set up a user XXX and use whatever uid/gid you like (e.g. 1000).

https://code.qt.io/cgit/qbs/qbs.git/tree/docker/bionic/test-android.Dockerfile

2. enable password-less sudo for this user
3. switch to that user before running qbs config to set up the profiles
4. Running the container, mount the current folder as the working dir
3. add an entrypoint script that looks at the uid/gid of the
   working dir and adjust the uid/gid of XXX in the container
   to match it.
   https://code.qt.io/cgit/qbs/qbs.git/tree/docker/bionic/entrypoint.sh

5. Run the container with docker-compose which cuts the Docker command line
down to:
      docker-compose run --rm IMAGESERVICENAME qbs build ...

   https://code.qt.io/cgit/qbs/qbs.git/tree/docker-compose.yml
   Docker-compose mounts the current directory and does additional stuff
   for you. I always have a docker-compose.yml in projects where
   the build environment is in a Docker container.

You can see it in action here:
https://code.qt.io/cgit/qbs/qbs.git/tree/.travis.yml#n75


More information about the Qbs mailing list