Skip to content

Scanning with the Lineai .NET Agent (Docker)

The Lineai .NET Agent for Docker provides an easy way to integrate Lineai scanning into your build process.

Pull and run the .NET agent image from your Lineai server registry:

Terminal window
docker run --pull always --rm --interactive \
--env LINEAI_HOST="https://yourinstance.app.lineai.com/lineai/server/" \
--env AGENT_UUID="your-agent-uuid" \
--env AGENT_PASSWORD="your-agent-password" \
--volume /path/to/scan:/scan \
yourinstance.app.lineai.com/lineai_dotnet:latest \
--application "Your Application" \
--path /scan

Docker options:

  • —pull always — ensures that you always get the newest image
  • —env LINEAI_HOST — Lineai server URL
  • —env AGENT_UUID / —env AGENT_PASSWORD — agent credentials
  • —volume — mounts the host directory to scan into the container
  • See Docker Documentation for more options.

Optional filters and database targets use NetCapePro CLI flags:

Terminal window
--application "Your Application" --path /scan --namespace com.example --include MyAssembly --database jdbc:postgresql://localhost:5432/sampledb

For the native Windows agent CLI, see Binary Scanning via Command Line (.NET).

The Lineai .NET Agent for Docker can be used to scan artifacts in Jenkins pipelines.

Example:

stage('Lineai Scan EKS') {
when {
expression { BRANCH_NAME ==~ /(integration|v.*|feature\/.*)/ }
}
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
// Publish Lineai Scan
sh('''
docker run --pull always --rm --interactive \
--env LINEAI_HOST="https://yourinstance.app.lineai.com/lineai/server/" \
--env "AGENT_UUID=${AGENT_UUID}" \
--env "AGENT_PASSWORD=${AGENT_PASSWORD}" \
--volume "${WORKSPACE}/path/to/assemblies":/scan \
yourinstance.app.lineai.com/lineai_dotnet:latest \
--application "Your Application" \
--path /scan \
--scan-space-name "Development" \
--namespace Example \
--include Example \
--rescan \
--expunge-scan-sessions
''')
}
}
}