1
0
mirror of https://github.com/stucki/docker-lineageos synced 2024-12-19 17:12:29 -05:00

Merge pull request #33 from ontherunvaro/patch-3

Ensure build user has the same UID and GID as the host user
This commit is contained in:
Michael Stucki 2017-04-20 18:27:54 +02:00 committed by GitHub
commit 4175e4d5e3
2 changed files with 10 additions and 2 deletions

View File

@ -21,7 +21,13 @@ RUN apt-get install -y android-tools-adb android-tools-fastboot
RUN apt-get install -y bc bsdmainutils file screen
RUN apt-get install -y bash-completion wget nano
RUN useradd build && rsync -a /etc/skel/ /home/build/
ARG hostuid=1000
ARG hostgid=1000
RUN \
groupadd build -g $hostgid && \
useradd build -g $hostgid -u $hostuid && \
rsync -a /etc/skel/ /home/build/
RUN mkdir /home/build/bin
RUN curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > /home/build/bin/repo

4
run.sh
View File

@ -48,7 +48,9 @@ elif [[ $FORCE_BUILD = 1 ]] || ! echo "$IMAGE_EXISTS" | grep -q "$TAG"; then
docker pull ubuntu:16.04
echo "Building Docker image $REPOSITORY:$TAG..."
docker build -t $REPOSITORY:$TAG .
USERID=$(id -u)
GROUPID=$(id -g)
docker build -t $REPOSITORY:$TAG --build-arg hostuid=$USERID --build-arg hostgid=$GROUPID .
OK=$?
# After successful build, delete existing containers