Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit a039c58

Browse files
committed
add rpm support
Extend containerdiff to support images that are shipped with rpm packages, such as SUSE or RedHat based ones. In contrast to apt, the rpm package data is not stored in a single text file, but in Berkeley databases, which complicates analyses. Hence, run those images in containers to query the package data directly via `rpm -qa` to make analyses portable at the cost of requiring a docker daemon to be installed and running. Analyzing tar archives requires some additional work in order to run them in a container. Multilayer tar archives generated by `docker save` must be loaded (see `docker load`), which would rename an already present image in case of a name conflict. Hence, update the manifest.json file of the archive and update the RepoTags fields in the form of `containerdiff:$TAG`, with $TAG being randomly generated. Signed-off-by: Valentin Rothberg <[email protected]>
1 parent 1f8b465 commit a039c58

File tree

181 files changed

+33983
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+33983
-1
lines changed

differs/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ go_library(
1010
"node_diff.go",
1111
"package_differs.go",
1212
"pip_diff.go",
13+
"rpm_diff.go",
1314
],
1415
importpath = "github.com/GoogleCloudPlatform/container-diff/differs",
1516
visibility = ["//visibility:public"],
1617
deps = [
1718
"//pkg/util:go_default_library",
1819
"//util:go_default_library",
20+
"//vendor/github.com/containers/image/docker/tarfile:go_default_library",
21+
"//vendor/github.com/fsouza/go-dockerclient:go_default_library",
22+
"//vendor/github.com/nightlyone/lockfile:go_default_library",
1923
"//vendor/github.com/sirupsen/logrus:go_default_library",
2024
],
2125
)
@@ -27,6 +31,7 @@ go_test(
2731
"differs_test.go",
2832
"node_diff_test.go",
2933
"pip_diff_test.go",
34+
"rpm_diff_test.go",
3035
],
3136
importpath = "github.com/GoogleCloudPlatform/container-diff/differs",
3237
library = ":go_default_library",

differs/differs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var Analyzers = map[string]Analyzer{
4545
"history": HistoryAnalyzer{},
4646
"file": FileAnalyzer{},
4747
"apt": AptAnalyzer{},
48+
"rpm": RPMAnalyzer{},
4849
"pip": PipAnalyzer{},
4950
"node": NodeAnalyzer{},
5051
}

0 commit comments

Comments
 (0)