Some beginner questions...

Alexander Neundorf neundorf at kde.org
Sat Mar 5 21:34:10 GMT 2022


On Samstag, 5. März 2022 20:52:59 CET Ben Cooksley wrote:
> On Sun, Mar 6, 2022 at 8:01 AM Alexander Neundorf <neundorf at kde.org> wrote:
> > On Samstag, 5. März 2022 19:11:53 CET Ben Cooksley wrote:
> > > On Sun, Mar 6, 2022 at 6:17 AM Alexander Neundorf <neundorf at kde.org>
> > 
> > wrote:
> > > > On Sonntag, 21. November 2021 21:38:14 CET Albert Astals Cid wrote:
> > > > > El diumenge, 21 de novembre de 2021, a les 18:20:08 (CET), Alexander
> > > > 
> > > > Neundorf va escriure:
> > > > ...
> > > > 
> > > > > > Is there a reason why less, vi and mc are not part of the image ?
> > > > > > They make working in the container much nicer :-)
> > > > > 
> > > > > You can always
> > > > > 
> > > > >   sudo apt install vim
> > > > > 
> > > > > no?
> > > > 
> > > > I get errors:
> > > > I have no name!@8fdf0c048ce2:~$ sudo apt-get install vim
> > > > sudo: you do not exist in the passwd database
> > > > I have no name!@8fdf0c048ce2:~$
> > > 
> > > If you'd like to be root then something like this should work:
> > > 
> > > docker exec -u root $containerId /bin/bash
> > > 
> > > Bit unusual that you have managed to get a shell as a user account that
> > > does not exist, by default both our SUSE CI images and the Android CI
> > 
> > image
> > 
> > > should run shells as root.
> > > The Android SDK image should spawn a shell as 'user' (UID 1000)
> > 
> > I mounted my host users src-directory into the container, so I need to
> > have
> > the same user- and group-ids in the container as on the host.
> > If I run as root in the container, I am also root on the directory which I
> > mounted into the container, so if I touch something in the container, it's
> > owned by root, also on the host.
> > Using the same user ID in the container as on the host makes that work
> > smoothly (but then I'm not root and cannot install anything).
> > Then I can simply edit on the host using kate or whatever, and build in
> > the
> > container, and nothing is lost, neither sources nor build results.
> 
> I see. In this case I would suggest creating (via a root terminal) a
> matching user account/group in the container before beginning usage of it.
> 
> The normal 'user' account in the container is created with UID 1000 I
> believe which for the vast majority of people should match their host
> system.
> 
> > Maybe during container startup the /etc/sudoers could be patched so that
> > it
> > allows the user who is running it can do sudo...
> 
> We don't allow sudo because permitting that would allow attacks against the
> CI system physical hosts.

the attached rough script works for me for now. :-)

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run_kdeandroid
Type: application/x-shellscript
Size: 1337 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-android/attachments/20220305/7b517a3d/attachment-0001.bin>


More information about the KDE-Android mailing list