File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 "default" : " " ,
2222 "description" : " Select or enter additional plugins to install with Trivy (e.g., mcp for Model Context Protocol plugin)"
2323 }
24+ },
25+ "containerEnv" : {
26+ "TRIVY_HOME" : " /usr/local/share/trivy"
2427 }
2528}
Original file line number Diff line number Diff line change 22
33TRIVY_VERSION=" ${VERSION:- " latest" } "
44TRIVY_PLUGINS=" ${PLUGINS:- " " } "
5+ TRIVY_HOME=" /usr/local/share/trivy"
56
67set -e
78
@@ -85,12 +86,21 @@ curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/inst
8586# Verify installation
8687trivy --version
8788
89+ # Set up shared TRIVY_HOME so plugins are available to all users
90+ mkdir -p " ${TRIVY_HOME} "
91+ export TRIVY_HOME
92+
8893# Install plugins if specified
8994if [ -n " ${TRIVY_PLUGINS} " ]; then
9095 echo " Installing Trivy plugins..."
9196 install_plugins " ${TRIVY_PLUGINS} "
9297fi
9398
99+ # Ensure TRIVY_HOME is set for all users at runtime
100+ echo " export TRIVY_HOME=${TRIVY_HOME} " > /etc/profile.d/trivy.sh
101+ chmod +x /etc/profile.d/trivy.sh
102+ chmod -R a+rX " ${TRIVY_HOME} "
103+
94104# Clean up
95105rm -rf /var/lib/apt/lists/*
96106
You can’t perform that action at this time.
0 commit comments