Permalink
Browse files

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 <vrothberg@suse.com>
  • Loading branch information...
vrothberg committed Nov 26, 2017
1 parent 1f8b465 commit a039c5878b41c13a991c5e0d3a05052b9881ccc6
Showing with 33,983 additions and 1 deletion.
  1. +5 −0 differs/BUILD.bazel
  2. +1 −0 differs/differs.go
  3. +414 −0 differs/rpm_diff.go
  4. +68 −0 differs/rpm_diff_test.go
  5. +1 −1 test.sh
  6. +18 −0 tests/integration_test.go
  7. +863 −0 tests/rpm_analysis_expected.json
  8. +29 −0 tests/rpm_diff_expected.json
  9. +13 −0 vendor/github.com/Nvveen/Gotty/BUILD.bazel
  10. +26 −0 vendor/github.com/Nvveen/Gotty/LICENSE
  11. +5 −0 vendor/github.com/Nvveen/Gotty/README
  12. +514 −0 vendor/github.com/Nvveen/Gotty/attributes.go
  13. +244 −0 vendor/github.com/Nvveen/Gotty/gotty.go
  14. +362 −0 vendor/github.com/Nvveen/Gotty/parser.go
  15. +23 −0 vendor/github.com/Nvveen/Gotty/types.go
  16. +35 −0 vendor/github.com/docker/docker/opts/BUILD.bazel
  17. +48 −0 vendor/github.com/docker/docker/opts/env.go
  18. +165 −0 vendor/github.com/docker/docker/opts/hosts.go
  19. +8 −0 vendor/github.com/docker/docker/opts/hosts_unix.go
  20. +6 −0 vendor/github.com/docker/docker/opts/hosts_windows.go
  21. +47 −0 vendor/github.com/docker/docker/opts/ip.go
  22. +337 −0 vendor/github.com/docker/docker/opts/opts.go
  23. +6 −0 vendor/github.com/docker/docker/opts/opts_unix.go
  24. +56 −0 vendor/github.com/docker/docker/opts/opts_windows.go
  25. +37 −0 vendor/github.com/docker/docker/opts/quotedstring.go
  26. +79 −0 vendor/github.com/docker/docker/opts/runtime.go
  27. +81 −0 vendor/github.com/docker/docker/opts/ulimit.go
  28. +62 −0 vendor/github.com/docker/docker/pkg/archive/BUILD.bazel
  29. +1 −0 vendor/github.com/docker/docker/pkg/archive/README.md
  30. +1,237 −0 vendor/github.com/docker/docker/pkg/archive/archive.go
  31. +92 −0 vendor/github.com/docker/docker/pkg/archive/archive_linux.go
  32. +7 −0 vendor/github.com/docker/docker/pkg/archive/archive_other.go
  33. +114 −0 vendor/github.com/docker/docker/pkg/archive/archive_unix.go
  34. +79 −0 vendor/github.com/docker/docker/pkg/archive/archive_windows.go
  35. +441 −0 vendor/github.com/docker/docker/pkg/archive/changes.go
  36. +313 −0 vendor/github.com/docker/docker/pkg/archive/changes_linux.go
  37. +97 −0 vendor/github.com/docker/docker/pkg/archive/changes_other.go
  38. +37 −0 vendor/github.com/docker/docker/pkg/archive/changes_unix.go
  39. +30 −0 vendor/github.com/docker/docker/pkg/archive/changes_windows.go
  40. +472 −0 vendor/github.com/docker/docker/pkg/archive/copy.go
  41. +11 −0 vendor/github.com/docker/docker/pkg/archive/copy_unix.go
  42. +9 −0 vendor/github.com/docker/docker/pkg/archive/copy_windows.go
  43. +256 −0 vendor/github.com/docker/docker/pkg/archive/diff.go
  44. +97 −0 vendor/github.com/docker/docker/pkg/archive/example_changes.go
  45. +16 −0 vendor/github.com/docker/docker/pkg/archive/time_linux.go
  46. +16 −0 vendor/github.com/docker/docker/pkg/archive/time_unsupported.go
  47. +23 −0 vendor/github.com/docker/docker/pkg/archive/whiteouts.go
  48. +59 −0 vendor/github.com/docker/docker/pkg/archive/wrap.go
  49. +22 −0 vendor/github.com/docker/docker/pkg/fileutils/BUILD.bazel
  50. +298 −0 vendor/github.com/docker/docker/pkg/fileutils/fileutils.go
  51. +27 −0 vendor/github.com/docker/docker/pkg/fileutils/fileutils_darwin.go
  52. +22 −0 vendor/github.com/docker/docker/pkg/fileutils/fileutils_unix.go
  53. +7 −0 vendor/github.com/docker/docker/pkg/fileutils/fileutils_windows.go
  54. +32 −0 vendor/github.com/docker/docker/pkg/homedir/BUILD.bazel
  55. +23 −0 vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go
  56. +13 −0 vendor/github.com/docker/docker/pkg/homedir/homedir_others.go
  57. +34 −0 vendor/github.com/docker/docker/pkg/homedir/homedir_unix.go
  58. +24 −0 vendor/github.com/docker/docker/pkg/homedir/homedir_windows.go
  59. +40 −0 vendor/github.com/docker/docker/pkg/idtools/BUILD.bazel
  60. +279 −0 vendor/github.com/docker/docker/pkg/idtools/idtools.go
  61. +226 −0 vendor/github.com/docker/docker/pkg/idtools/idtools_unix.go
  62. +25 −0 vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go
  63. +164 −0 vendor/github.com/docker/docker/pkg/idtools/usergroupadd_linux.go
  64. +12 −0 vendor/github.com/docker/docker/pkg/idtools/usergroupadd_unsupported.go
  65. +32 −0 vendor/github.com/docker/docker/pkg/idtools/utils_unix.go
  66. +13 −0 vendor/github.com/docker/docker/pkg/jsonmessage/BUILD.bazel
  67. +317 −0 vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go
  68. +9 −0 vendor/github.com/docker/docker/pkg/pools/BUILD.bazel
  69. +137 −0 vendor/github.com/docker/docker/pkg/pools/pools.go
  70. +8 −0 vendor/github.com/docker/docker/pkg/stdcopy/BUILD.bazel
  71. +190 −0 vendor/github.com/docker/docker/pkg/stdcopy/stdcopy.go
  72. +41 −0 vendor/github.com/docker/docker/pkg/term/BUILD.bazel
  73. +66 −0 vendor/github.com/docker/docker/pkg/term/ascii.go
  74. +74 −0 vendor/github.com/docker/docker/pkg/term/proxy.go
  75. +20 −0 vendor/github.com/docker/docker/pkg/term/tc.go
  76. +124 −0 vendor/github.com/docker/docker/pkg/term/term.go
  77. +230 −0 vendor/github.com/docker/docker/pkg/term/term_windows.go
  78. +42 −0 vendor/github.com/docker/docker/pkg/term/termios_bsd.go
  79. +39 −0 vendor/github.com/docker/docker/pkg/term/termios_linux.go
  80. +26 −0 vendor/github.com/docker/docker/pkg/term/windows/BUILD.bazel
  81. +263 −0 vendor/github.com/docker/docker/pkg/term/windows/ansi_reader.go
  82. +64 −0 vendor/github.com/docker/docker/pkg/term/windows/ansi_writer.go
  83. +35 −0 vendor/github.com/docker/docker/pkg/term/windows/console.go
  84. +33 −0 vendor/github.com/docker/docker/pkg/term/windows/windows.go
  85. +20 −0 vendor/github.com/docker/docker/pkg/term/winsize.go
  86. +4 −0 vendor/github.com/fsouza/.gitignore
  87. +31 −0 vendor/github.com/fsouza/.travis.yml
  88. +186 −0 vendor/github.com/fsouza/go-dockerclient/AUTHORS
  89. +120 −0 vendor/github.com/fsouza/go-dockerclient/BUILD.bazel
  90. +6 −0 vendor/github.com/fsouza/go-dockerclient/DOCKER-LICENSE
  91. +28 −0 vendor/github.com/fsouza/go-dockerclient/Gopkg.toml
  92. +22 −0 vendor/github.com/fsouza/go-dockerclient/LICENSE
  93. +42 −0 vendor/github.com/fsouza/go-dockerclient/Makefile
  94. +133 −0 vendor/github.com/fsouza/go-dockerclient/README.markdown
  95. +21 −0 vendor/github.com/fsouza/go-dockerclient/appveyor.yml
  96. +182 −0 vendor/github.com/fsouza/go-dockerclient/auth.go
  97. +169 −0 vendor/github.com/fsouza/go-dockerclient/auth_test.go
  98. +165 −0 vendor/github.com/fsouza/go-dockerclient/build_test.go
  99. +43 −0 vendor/github.com/fsouza/go-dockerclient/change.go
  100. +25 −0 vendor/github.com/fsouza/go-dockerclient/change_test.go
  101. +1,073 −0 vendor/github.com/fsouza/go-dockerclient/client.go
  102. +135 −0 vendor/github.com/fsouza/go-dockerclient/client_stress_test.go
  103. +846 −0 vendor/github.com/fsouza/go-dockerclient/client_test.go
  104. +29 −0 vendor/github.com/fsouza/go-dockerclient/client_unix.go
  105. +69 −0 vendor/github.com/fsouza/go-dockerclient/client_unix_test.go
  106. +44 −0 vendor/github.com/fsouza/go-dockerclient/client_windows.go
  107. +44 −0 vendor/github.com/fsouza/go-dockerclient/client_windows_test.go
  108. +1,612 −0 vendor/github.com/fsouza/go-dockerclient/container.go
  109. +2,789 −0 vendor/github.com/fsouza/go-dockerclient/container_test.go
  110. +108 −0 vendor/github.com/fsouza/go-dockerclient/container_unix_test.go
  111. +26 −0 vendor/github.com/fsouza/go-dockerclient/distribution.go
  112. +54 −0 vendor/github.com/fsouza/go-dockerclient/distribution_test.go
  113. +172 −0 vendor/github.com/fsouza/go-dockerclient/env.go
  114. +371 −0 vendor/github.com/fsouza/go-dockerclient/env_test.go
  115. +395 −0 vendor/github.com/fsouza/go-dockerclient/event.go
  116. +303 −0 vendor/github.com/fsouza/go-dockerclient/event_test.go
  117. +138 −0 vendor/github.com/fsouza/go-dockerclient/example_test.go
  118. +214 −0 vendor/github.com/fsouza/go-dockerclient/exec.go
  119. +246 −0 vendor/github.com/fsouza/go-dockerclient/exec_test.go
  120. +720 −0 vendor/github.com/fsouza/go-dockerclient/image.go
  121. +1,178 −0 vendor/github.com/fsouza/go-dockerclient/image_test.go
  122. +94 −0 vendor/github.com/fsouza/go-dockerclient/integration_test.go
  123. +182 −0 vendor/github.com/fsouza/go-dockerclient/misc.go
  124. +208 −0 vendor/github.com/fsouza/go-dockerclient/misc_test.go
  125. +322 −0 vendor/github.com/fsouza/go-dockerclient/network.go
  126. +276 −0 vendor/github.com/fsouza/go-dockerclient/network_test.go
  127. +49 −0 vendor/github.com/fsouza/go-dockerclient/signal.go
  128. +156 −0 vendor/github.com/fsouza/go-dockerclient/swarm.go
  129. +171 −0 vendor/github.com/fsouza/go-dockerclient/swarm_configs.go
  130. +251 −0 vendor/github.com/fsouza/go-dockerclient/swarm_configs_test.go
  131. +130 −0 vendor/github.com/fsouza/go-dockerclient/swarm_node.go
  132. +261 −0 vendor/github.com/fsouza/go-dockerclient/swarm_node_test.go
  133. +171 −0 vendor/github.com/fsouza/go-dockerclient/swarm_secrets.go
  134. +285 −0 vendor/github.com/fsouza/go-dockerclient/swarm_secrets_test.go
  135. +216 −0 vendor/github.com/fsouza/go-dockerclient/swarm_service.go
  136. +597 −0 vendor/github.com/fsouza/go-dockerclient/swarm_service_test.go
  137. +70 −0 vendor/github.com/fsouza/go-dockerclient/swarm_task.go
  138. +376 −0 vendor/github.com/fsouza/go-dockerclient/swarm_task_test.go
  139. +210 −0 vendor/github.com/fsouza/go-dockerclient/swarm_test.go
  140. +117 −0 vendor/github.com/fsouza/go-dockerclient/tar.go
  141. +31 −0 vendor/github.com/fsouza/go-dockerclient/testing/BUILD.bazel
  142. +3 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/.dockerignore
  143. +15 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/Dockerfile
  144. 0 vendor/github.com/fsouza/go-dockerclient/testing/data/barfile
  145. +23 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/ca.pem
  146. +20 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/cert.pem
  147. BIN vendor/github.com/fsouza/go-dockerclient/testing/data/container.tar
  148. BIN vendor/github.com/fsouza/go-dockerclient/testing/data/dockerfile.tar
  149. 0 vendor/github.com/fsouza/go-dockerclient/testing/data/foofile
  150. +27 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/key.pem
  151. +20 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/server.pem
  152. +27 −0 vendor/github.com/fsouza/go-dockerclient/testing/data/serverkey.pem
  153. +1,604 −0 vendor/github.com/fsouza/go-dockerclient/testing/server.go
  154. +2,620 −0 vendor/github.com/fsouza/go-dockerclient/testing/server_test.go
  155. +695 −0 vendor/github.com/fsouza/go-dockerclient/testing/swarm.go
  156. +1,396 −0 vendor/github.com/fsouza/go-dockerclient/testing/swarm_test.go
  157. +118 −0 vendor/github.com/fsouza/go-dockerclient/tls.go
  158. +18 −0 vendor/github.com/fsouza/go-dockerclient/travis-scripts/install-docker.bash
  159. +11 −0 vendor/github.com/fsouza/go-dockerclient/travis-scripts/run-tests.bash
  160. +171 −0 vendor/github.com/fsouza/go-dockerclient/volume.go
  161. +180 −0 vendor/github.com/fsouza/go-dockerclient/volume_test.go
  162. +27 −0 vendor/github.com/nightlyone/lockfile/.gitignore
  163. +3 −0 vendor/github.com/nightlyone/lockfile/.gitmodules
  164. +14 −0 vendor/github.com/nightlyone/lockfile/.travis.yml
  165. +28 −0 vendor/github.com/nightlyone/lockfile/BUILD.bazel
  166. +19 −0 vendor/github.com/nightlyone/lockfile/LICENSE
  167. +52 −0 vendor/github.com/nightlyone/lockfile/README.md
  168. +12 −0 vendor/github.com/nightlyone/lockfile/appveyor.yml
  169. +211 −0 vendor/github.com/nightlyone/lockfile/lockfile.go
  170. +308 −0 vendor/github.com/nightlyone/lockfile/lockfile_test.go
  171. +20 −0 vendor/github.com/nightlyone/lockfile/lockfile_unix.go
  172. +30 −0 vendor/github.com/nightlyone/lockfile/lockfile_windows.go
  173. +32 −0 vendor/github.com/opencontainers/runc/libcontainer/system/BUILD.bazel
  174. +136 −0 vendor/github.com/opencontainers/runc/libcontainer/system/linux.go
  175. +113 −0 vendor/github.com/opencontainers/runc/libcontainer/system/proc.go
  176. +26 −0 vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_32.go
  177. +26 −0 vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go
  178. +12 −0 vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig.go
  179. +15 −0 vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig_notcgo.go
  180. +9 −0 vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go
  181. +35 −0 vendor/github.com/opencontainers/runc/libcontainer/system/xattrs_linux.go
View
@@ -10,12 +10,16 @@ go_library(
"node_diff.go",
"package_differs.go",
"pip_diff.go",
"rpm_diff.go",
],
importpath = "github.com/GoogleCloudPlatform/container-diff/differs",
visibility = ["//visibility:public"],
deps = [
"//pkg/util:go_default_library",
"//util:go_default_library",
"//vendor/github.com/containers/image/docker/tarfile:go_default_library",
"//vendor/github.com/fsouza/go-dockerclient:go_default_library",
"//vendor/github.com/nightlyone/lockfile:go_default_library",
"//vendor/github.com/sirupsen/logrus:go_default_library",
],
)
@@ -27,6 +31,7 @@ go_test(
"differs_test.go",
"node_diff_test.go",
"pip_diff_test.go",
"rpm_diff_test.go",
],
importpath = "github.com/GoogleCloudPlatform/container-diff/differs",
library = ":go_default_library",
View
@@ -45,6 +45,7 @@ var Analyzers = map[string]Analyzer{
"history": HistoryAnalyzer{},
"file": FileAnalyzer{},
"apt": AptAnalyzer{},
"rpm": RPMAnalyzer{},
"pip": PipAnalyzer{},
"node": NodeAnalyzer{},
}
Oops, something went wrong.

0 comments on commit a039c58

Please sign in to comment.