Skip to content

Commit a5f0ef5

Browse files
Ferenc-knqyf263
andauthored
docs: add note about temporary podman socket (#7921)
Signed-off-by: Ferenc Géczi <[email protected]> Signed-off-by: Ferenc Géczi <[email protected]> Co-authored-by: knqyf263 <[email protected]>
1 parent 94791f8 commit a5f0ef5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/docs/target/container_image.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ $ trivy image aquasec/nginx
272272
This feature might change without preserving backwards compatibility.
273273

274274
Scan your image in Podman (>=2.0) running locally. The remote Podman is not supported.
275-
Before performing Trivy commands, you must enable the podman.sock systemd service on your machine.
275+
If you prefer to keep the socket open at all times, then before performing Trivy commands, you can enable the podman.sock systemd service on your machine.
276276
For more details, see [here](https://github.com/containers/podman/blob/master/docs/tutorials/remote_client.md#enable-the-podman-service-on-the-server-machine).
277277

278278

@@ -293,6 +293,15 @@ localhost/test latest efc372d4e0de About a minute ago 7.94 MB
293293
$ trivy image test
294294
```
295295

296+
If you prefer not to keep the socket open at all times, but to limit the socket opening for your trivy scanning duration only then you can scan your image with the following command:
297+
298+
```bash
299+
podman system service --time=0 "${TMP_PODMAN_SOCKET}" &
300+
PODMAN_SYSTEM_SERVICE_PID="$!"
301+
trivy image --podman-host="${TMP_PODMAN_SOCKET}" --docker-host="${TMP_PODMAN_SOCKET}" test
302+
kill "${PODMAN_SYSTEM_SERVICE_PID}"
303+
```
304+
296305
### Container Registry
297306
Trivy supports registries that comply with the following specifications.
298307

0 commit comments

Comments
 (0)