Skip to content

Commit

Permalink
fix: bind docker uid and gid
Browse files Browse the repository at this point in the history
  • Loading branch information
CnTeng committed Oct 29, 2024
1 parent 08315e0 commit 24a397e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ LABEL maintainer="[email protected]" \
RUN apt update && apt install -y sudo curl git xz-utils

# create user dev
RUN useradd -m -s /bin/bash dev && usermod -aG sudo dev
RUN echo "dev ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers
ARG USER_UID=1000

RUN id "ubuntu" >/dev/null 2>&1 && userdel -r ubuntu || echo "user ubuntu not found"

RUN useradd -m -G users,sudo -N -s /bin/bash -u ${USER_UID} dev && \
echo "dev ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers

USER dev

Expand Down

0 comments on commit 24a397e

Please sign in to comment.