Skip to content

Commit

Permalink
fix: Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Nov 8, 2023
1 parent ff3dabe commit e5f4e87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/types/buf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ RUN npm install -g ts-proto

COPY --from=BUILDER /usr/local/bin /usr/local/bin

# Inject user id and group id to avoid permission issues
# Inject user id and group id to avoid permission issues when running as a root user
ARG USER_ID=1000
ARG USER_GID=1000

# Create user and group if they don't exist
# Create group if it doesn't exist
RUN if ! getent group $USER_GID; then \
addgroup -g $USER_GID mygroup; \
fi

# Create user if it doesn't exist
RUN if ! getent passwd $USER_ID; then \
adduser -D -u $USER_ID -G mygroup myuser; \
adduser -D -u $USER_ID -G $(getent group $USER_GID | cut -d: -f1) myuser; \
fi

# Change to user
Expand Down

0 comments on commit e5f4e87

Please sign in to comment.