Skip to content

Commit

Permalink
fix: make sudo to be no password
Browse files Browse the repository at this point in the history
  • Loading branch information
khos2ow committed Jan 8, 2025
1 parent 6b0eb30 commit ac6f903
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ ENV DEBIAN_FRONTEND="noninteractive"
ARG PACKAGES=${PACKAGES:-sudo}
RUN apt update -qq && apt install --no-install-recommends -y $PACKAGES

RUN useradd -m -u 1000 regolith && adduser regolith sudo
USER regolith
RUN useradd -m -u 1000 regolith && \
adduser regolith sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER regolith
WORKDIR /build
8 changes: 5 additions & 3 deletions ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ ENV DEBIAN_FRONTEND="noninteractive"
ARG PACKAGES=${PACKAGES:-sudo}
RUN apt update -qq && apt install --no-install-recommends -y $PACKAGES

RUN if id ubuntu >/dev/null 2>&1; then userdel -r ubuntu; fi
RUN useradd -m -u 1000 regolith && adduser regolith sudo
USER regolith
RUN if id ubuntu >/dev/null 2>&1; then userdel -r ubuntu; fi && \
useradd -m -u 1000 regolith && \
adduser regolith sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER regolith
WORKDIR /build

0 comments on commit ac6f903

Please sign in to comment.