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 3d4bb80
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions images/ubuntu/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ 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 && \
echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers && \
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'

USER linuxbrew
Expand All @@ -23,6 +24,5 @@ RUN curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.s
USER root

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

CMD sudo chown -R "$(whoami):$(whoami)" /home/linuxbrew/.linuxbrew
chmod 0755 /home/linuxbrew && \
userdel linuxbrew

0 comments on commit 3d4bb80

Please sign in to comment.