You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sysdig LSP builds your entire Dockerfile and scans the resulting final image to identify vulnerabilities early in your development workflow.
4
+
This ensures the exact image used in production is secure and compliant.
5
+
6
+
> [!IMPORTANT]
7
+
> Sysdig LSP analyzes the fully built final image, including all instructions executed during the build process.
8
+
>
9
+
> In multi-stage Dockerfiles, only artifacts copied into the final stage using instructions like `COPY --from=build` are analyzed, as intermediate stages are not part of the final runtime environment.
10
+
11
+

12
+
13
+
## Examples
14
+
15
+
### Single-stage Dockerfile (scanned entirely)
16
+
17
+
```dockerfile
18
+
# Base image and all instructions are scanned
19
+
FROM alpine:latest
20
+
RUN apk add --no-cache python3
21
+
COPY ./app /app
22
+
```
23
+
24
+
### Multi-stage Dockerfile (partially scanned)
25
+
26
+
```dockerfile
27
+
# Build stage (scanned only for artifacts copied to final stage)
28
+
FROM golang:1.19 AS build
29
+
RUN go build -o app main.go
30
+
31
+
# Final image (fully scanned)
32
+
FROM alpine:3.17
33
+
COPY --from=build /app /app
34
+
ENTRYPOINT ["/app"]
35
+
```
36
+
37
+
In this multi-stage Dockerfile, Sysdig LSP scans the complete final built image, including the final runtime stage (`alpine:3.17`) and any artifacts explicitly copied from previous stages (`golang:1.19`).
0 commit comments