Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collisions with existing user and group ids #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ ARG RUBY_VERSION=3.3.4
FROM ruby:${RUBY_VERSION}
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g $GROUP_ID app && useradd -u $USER_ID -g app -m app
USER app
RUN (getent group $GROUP_ID > /dev/null || groupadd -g $GROUP_ID app) && \
(getent passwd $USER_ID > /dev/null || useradd -u $USER_ID -g $GROUP_ID -m app)
USER $USER_ID:$GROUP_ID
ARG RAILS_VERSION
# Install Rails based on the version specified but if not specified, install the latest version.
RUN if [ -z "$RAILS_VERSION" ] ; then gem install rails ; else gem install rails -v $RAILS_VERSION ; fi
Loading