File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11FROM --platform=linux/amd64 ghcr.io/rails/devcontainer/images/ruby:3.2.2
22
3+ # Switch to root to install dependencies
4+ USER root
5+
36RUN set -xe \
47 && apt update && apt -y upgrade
58
@@ -32,9 +35,10 @@ RUN set -xe \
3235 && apt update \
3336 && apt -y install --no-install-recommends google-chrome-stable
3437
35- # Create a User
38+ # Create a non-root user
3639RUN set -xe \
37- && echo 'ALL ALL = (ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers
40+ && useradd -m -s /bin/bash appuser \
41+ && echo 'appuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
3842
3943# Install NodeJS
4044RUN set -xe \
@@ -48,3 +52,6 @@ RUN set -xe \
4852# Install Application Dependencies
4953RUN set -xe \
5054 && apt -y install --no-install-recommends libpq-dev imagemagick libvips-dev libvips-tools libvips42 ruby-chromedriver-helper ruby-foreman
55+
56+ # Switch to non-root user
57+ USER appuser
You can’t perform that action at this time.
0 commit comments