Skip to content

Commit

Permalink
docker: revert back linuxbrew's UID to 1000
Browse files Browse the repository at this point in the history
In Homebrew#17584 we have changed "linuxbrew" user's UID/GID to 1001 in order to mitigate for Ubuntu 23.04 and higher, which started creating a default "ubuntu" user taking over UID/GID 1000 .

While we may desire a deterministic UID in the homebrew docker image, the change effectively modified the behaviour for all current 3 images based on Ubuntu 18.04 20.04 and 22.04 by changing the linuxbrew's user UID/GID from 1000 to 1001. As per https://hub.docker.com/u/homebrew, we do not currently publish an image for 24.04 which the change is mitigating for.

Rather than mitigating for indeterministic behaviour of upstream changes, this commit implements the workaround in https://bugs.launchpad.net/cloud-images/+bug/2005129 to delete the default "ubuntu" user.
  • Loading branch information
andreineculau authored and ctaintor committed Sep 4, 2024
1 parent 587e498 commit 893b24d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ ARG version=22.04
FROM ubuntu:"${version}"
ARG DEBIAN_FRONTEND=noninteractive

# Set the user ID to the default value of 1001 since different ubuntu
# versions yield to different user IDs with `useradd`
ENV USER_ID=1001
# Deterministic UID (first user). Helps with docker build cache
ENV USER_ID=1000
# Delete the default ubuntu user & group UID=1000 GID=1000 in Ubuntu 23.04+
# that conflicts with the linuxbrew user
RUN touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu; true

# We don't want to manually pin versions, happy to use whatever
# Ubuntu thinks is best.
Expand Down

0 comments on commit 893b24d

Please sign in to comment.