Replies: 1 comment
-
|
From some additional testing on a different machine, it seems Trivy behaves differently when it is given the short ID from I can't guarantee that the machine I was testing on is identical to our CI machines, but this is the best I can do. I don't particularly care which formats of the ID that Trivy accept as long as there is a human readable error message when giving the wrong format. That error message should preferably also indicate the expected format of the ID, so the user gets an idea of what they should do. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Docker Engine v29 uses the containerd image store by default for fresh installs (https://www.docker.com/blog/docker-engine-version-29/#containerd-image-store-becomes-the-default), and this caused our Trivy scans in CI to start failing because they were unable to get the right layers. Reverting to the graph storage backend (setting the
containerd-snapshottertofalsein thefeaturessection in/etc/docker/daemon.json) and restarting Docker made the Trivy scans work again.Here is the log of a failure:
The
b3e8b92255301d0135b65f1e293e0d7a7b0a26266d7c2ebe7d53831e7607e457in the log is the ID column from the output ofdocker images --no-trunc.I don't think there is anything special with our scanner-image, it's based on Ubuntu 24.04 image and is just doing
tar xf trivy.tar.gz -C /usr/local/bin/ --no-same-owner trivy contribto install the x86_64 tarball version of the Trivy release. The user inside the container has the required permissions for/var/run/docker.sock.Desired Behavior
The scan to complete just like it does when not using the containerd image store, or Trivy to detect that there is something wrong and give an error message containing some actionable instructions without having to run Trivy in debug mode.
Actual Behavior
I put the log of what happened in the description box.
Reproduction Steps
Target
Container Image
Scanner
None
Output Format
None
Mode
None
Debug Output
Don't have this, sorry.Operating System
Ubuntu 24.04
Version
Checklist
trivy clean --allBeta Was this translation helpful? Give feedback.
All reactions