Skip to content

Commit

Permalink
semgrep dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajmouriyakong committed Nov 15, 2024
1 parent dc72ac5 commit d6faf20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions security-actions/dockerfiles/semgrep.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ ARG SEMGREP_USER=semgrep
RUN addgroup -g 1001 $SEMGREP_USER && \
adduser -D -u 1001 -G $SEMGREP_USER $SEMGREP_USER

RUN chown $SEMGREP_USER:$SEMGREP_USER /usr/local/bin/semgrep
# Find the semgrep binary location and change ownership
RUN SEMGREP_PATH=$(which semgrep) && \
if [ -n "$SEMGREP_PATH" ]; then chown $SEMGREP_USER:$SEMGREP_USER $SEMGREP_PATH; fi

# Switch to the non-root user
USER $SEMGREP_USER
WORKDIR /home/$SEMGREP_USER

# Set the entrypoint to the semgrep command
ENTRYPOINT ["semgrep"]
ENTRYPOINT ["semgrep"]

0 comments on commit d6faf20

Please sign in to comment.