1
0
mirror of https://github.com/kylemanna/docker-aosp synced 2025-06-07 16:06:17 +00:00

9 Commits

Author SHA1 Message Date
Kyle Manna
ab9f7515dd utils/aosp: Only pass UID and GID arguments if NOT root
* Running as root will (among other things) try to re-create the root
  user in the container.  Avoid this by not passing the arguments and
  letting the container use its defaults.
2016-10-14 20:51:18 -07:00
Jean-Christophe Fillion-Robin
f1b7f6a6fa utils/aosp: If no AOSP_VOL is set, create aosp volume in current home
The script should not attempt to create a folder "/vol0" in the filesystem
of the host, instead the directory "~/aosp-root" is created.
2016-04-20 13:38:00 -04:00
Jean-Christophe Fillion-Robin
91ae4a8cdc utils/aosp: Update script and Dockerfile to work with any host user uid/gid
This commit introduces the "docker_entrypoint" script that will create
a user with uid/gid matching given `USER_ID` and `GROUP_ID` (or default to
`1000` if not provided).

Fixes #9

This approach works around missing docker feature discussed in
docker/docker#7198 and allow to have executable in the docker container
manipulating files in the shared volume owned by the `USER_ID:GROUP_ID`

The utility script `aosp` has also been updated to automatically
set `USER_ID` and `GROUP_ID` to the value matching the current user
by invoking "docker run" with

```
-e USER_ID=$(id -u) -e GROUP_ID=$(id -g)
```

Finally, the output has also been updated to be more verbose. For example:

```
$ AOSP_VOL=/home/jcfr/Projects/aosp-root/ aosp id
aosp: Checking if /home/jcfr/Projects/aosp-root/aosp exists
aosp: Checking if /home/jcfr/Projects/aosp-root/aosp exists - ok
aosp: Checking if /home/jcfr/Projects/aosp-root/ccache exists
aosp: Checking if /home/jcfr/Projects/aosp-root/ccache exists - ok

docker_entrypoint: Creating user UID/GID [1000/1000]
docker_entrypoint: Creating user UID/GID [1000/1000] - done
docker_entrypoint: Copying .gitconfig and .ssh/config to new user home
docker_entrypoint: Copying .gitconfig and .ssh/config to new user home - done
docker_entrypoint: Creating /tmp/ccache and /asop directory
docker_entrypoint: Creating /tmp/ccache and /asop directory - done

uid=1000(aosp) gid=1000(aosp) groups=1000(aosp)
```
2016-04-20 13:08:40 -04:00
Jean-Christophe Fillion-Robin
d7f0c4fe4c utils/aosp: Refactor code to display status message and remove chmod call
Now directories are owned by aosp user, there is not need to explicitly
chmod to 777. Current user will create and own the folder.
2016-04-19 13:48:55 -04:00
Jean-Christophe Fillion-Robin
d47f14dad0 utils/aosp: trim trailing slash of directories 2016-04-19 13:48:55 -04:00
Kyle Manna
4be024356f aosp: Fix volume directory existence test
* Typo.
2014-11-12 08:47:40 -08:00
Kyle Manna
55125c6fd2 aosp: Don't run sudo unless necessary
* Clean-up miscellaneous things
* Allow /vol0/aosp to be overridden
* Avoid calling sudo for no reason
2014-11-11 22:07:51 -08:00
Kyle Manna
9d55dd4c0f utils: aosp: Add additional args to append
* Add ability append args without overriding
2014-11-11 19:01:11 -08:00
Kyle Manna
3de604fbc3 utils: Add AOSP wrapper
* Add simple wrapper for making it easier to use the docker wrapper
2014-11-11 14:49:22 -08:00