- Switch Trivy installation to script-based method in Dockerfile.

This commit is contained in:
Guillaume "B.B." Van Hemmen 2025-06-25 16:27:01 +00:00
parent c3e3eed0e3
commit 5237516000

View file

@ -45,10 +45,9 @@ RUN echo "PS1='🐳 \[\033[1;36m\] \[\033[1;34m\]\W\[\033[0;35m\] \[\033[1;36m\]
chown -R coder:coder /workspaces
# Run trivy to scan the system
RUN apt-get update && apt-get install -y trivy && \
trivy filesystem --exit-code 1 --no-progress / && \
apt-get remove -y trivy && \
rm -rf /var/lib/apt/lists/*
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin \
&& trivy filesystem --exit-code 1 --no-progress / \
&& rm -rf /usr/local/bin/trivy
# Switch to non-root user
USER coder