mirror of
https://github.com/stucki/docker-lineageos
synced 2024-12-19 17:12:29 -05:00
Ensure build user has the same UID and GID as the host user
This prevents permission problems since volum owners are set from host
This commit is contained in:
parent
98bbfc0699
commit
80042bd00f
@ -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
4
run.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user