-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from rails/rm-fix-user
Generate the Rails application with the same user as the caller
- Loading branch information
Showing
8 changed files
with
75 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
ARG RUBY_VERSION=3.2.3 | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG RUBY_VERSION=3.2.3 | ||
FROM ruby:${RUBY_VERSION} | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pub fn dockerfile_content() -> &'static [u8] { | ||
include_bytes!("../Dockerfile") | ||
} | ||
|
||
pub fn get_user_id() -> Option<u32> { | ||
Some(users::get_current_uid()) | ||
} | ||
|
||
pub fn get_group_id() -> Option<u32> { | ||
Some(users::get_current_gid()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pub fn dockerfile_content() -> &'static [u8] { | ||
include_bytes!("../Dockerfile.windows") | ||
} | ||
|
||
pub fn get_user_id() -> Option<u32> { | ||
None | ||
} | ||
|
||
pub fn get_group_id() -> Option<u32> { | ||
None | ||
} |