Skip to content

Commit

Permalink
Use a default user id that is likely to match the uid of the host's user
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Sep 8, 2024
1 parent 85e31c5 commit c882069
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions images/ubuntu/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ RUN apt-get --assume-yes update && \
apt-get --assume-yes dist-upgrade && \
apt-get --assume-yes install --no-install-recommends build-essential git

ENV USER_ID=1111
ENV USER_ID=1000

RUN useradd -u "${USER_ID}" --create-home --shell /bin/bash --user-group linuxbrew && \
RUN userdel -r ubuntu && \
useradd -u "${USER_ID}" --create-home --shell /bin/bash --user-group linuxbrew && \
echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers && \
su - linuxbrew -c 'mkdir ~/.linuxbrew'

Expand All @@ -24,5 +25,3 @@ USER root

RUN chown root:root /home/linuxbrew && \
chmod 0755 /home/linuxbrew

CMD sudo chown -R "$(whoami):$(whoami)" /home/linuxbrew/.linuxbrew

0 comments on commit c882069

Please sign in to comment.