diff --git a/Dockerfile b/Dockerfile index 773cd8c..eb09298 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,5 @@ 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 diff --git a/Dockerfile.windows b/Dockerfile.unix similarity index 70% rename from Dockerfile.windows rename to Dockerfile.unix index eb09298..773cd8c 100644 --- a/Dockerfile.windows +++ b/Dockerfile.unix @@ -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 diff --git a/src/main.rs b/src/main.rs index 5235a1c..a753532 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,8 +10,8 @@ use clap::Parser; use crate::docker_client::DockerClient; -#[cfg_attr(unix, path = "unix.rs")] -#[cfg_attr(windows, path = "windows.rs")] +#[cfg_attr(all(unix, not(target_os = "macos")), path = "unix.rs")] +#[cfg_attr(any(windows, target_os = "macos"), path = "windows.rs")] mod os_specific; fn main() { diff --git a/src/unix.rs b/src/unix.rs index ffa173a..2c26e7b 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -1,5 +1,5 @@ pub fn dockerfile_content() -> &'static [u8] { - include_bytes!("../Dockerfile") + include_bytes!("../Dockerfile.unix") } pub fn get_user_id() -> Option { diff --git a/src/windows.rs b/src/windows.rs index a06c201..49ddb34 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -1,5 +1,5 @@ pub fn dockerfile_content() -> &'static [u8] { - include_bytes!("../Dockerfile.windows") + include_bytes!("../Dockerfile") } pub fn get_user_id() -> Option {