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

Commit 17e33eb

Browse files
committed
update docs
1 parent 8ae444a commit 17e33eb

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

README.md

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ Status](https://travis-ci.org/GoogleCloudPlatform/container-diff.svg?branch=mast
55

66
## What is container-diff?
77

8-
container-diff is an image analysis command line tool. container-diff can analyze images along several different criteria, currently including:
8+
container-diff is a tool for analyzing and comparing container images. container-diff can examine images along several different criteria, including:
99
- Docker Image History
1010
- Image file system
11-
- apt-get installed packages
12-
- pip installed packages
13-
- npm installed packages
14-
The above analyses can be performed on a single image, or a diff can be performed on two images to compare images.
15-
16-
This tool can help you as a developer better understand what is changing within your images and better understand what your images contain.
11+
- Apt packages
12+
- pip packages
13+
- npm packages
14+
These analyses can be performed on a single image, or a diff can be performed on two images to compare. The tool can help users better understand what is changing inside their images, and give them a better look at what their images contain.
1715

1816
## Installation
1917

@@ -39,10 +37,10 @@ Download the [container-diff-windows-amd64.exe](https://storage.googleapis.com/c
3937

4038
## Quickstart
4139

42-
To use `container-diff analyze` to perform analysis on a single image, you need one Docker image (in the form of an ID, tarball, or URL from a repo). Once you have that image, you can run any of the following analyzers:
40+
To use `container-diff analyze` to perform analysis on a single image, you need one Docker image (in the form of an ID, tarball, or URL from a repo). Once you have that image, you can run any of the following analyzers:
4341

4442
```
45-
container-diff analyze <img> [Run all analyzers]
43+
container-diff analyze <img> [Run default analyzers]
4644
container-diff analyze <img> --types=history [History]
4745
container-diff analyze <img> --types=file [File System]
4846
container-diff analyze <img> --types=pip [Pip]
@@ -52,7 +50,7 @@ container-diff analyze <img> --types=apt,node [Apt and Node]
5250
# --types=<analyzer1>,<analyzer2>,<analyzer3>,...
5351
```
5452

55-
To use container-diff to perform a diff analysis on two images, you need two Docker images (in the form of an ID, tarball, or URL from a repo). Once you have those images, you can run any of the following differs:
53+
To use container-diff to perform a diff analysis on two images, you need two Docker images (in the form of an ID, tarball, or URL from a repo). Once you have those images, you can run any of the following differs:
5654
```
5755
container-diff diff <img1> <img2> [Run all differs]
5856
container-diff diff <img1> <img2> --types=history [History]
@@ -65,7 +63,7 @@ container-diff diff <img1> <img2> --types=node [Node]
6563
You can similarly run many analyzers at once:
6664

6765
```
68-
container-diff diff <img1> <img2> --types=history,apt,node [History, Apt, and Node]
66+
container-diff diff <img1> <img2> --types=history,apt,node
6967
```
7068

7169
All of the analyzer flags with their long versions can be seen below:
@@ -96,27 +94,27 @@ To order files and packages by size (in descending order) when performing file s
9694

9795
## Analysis Result Format
9896

99-
The JSONs for analysis results are in the following format:
97+
JSON output for analysis results is in the following format:
10098
```
10199
{
102100
"Image": "foo",
103101
"AnalyzeType": "Apt",
104102
"Analysis": {},
105103
}
106104
```
107-
The possible structures of the `Analysis` field are detailed below.
105+
The possible contents of the `Analysis` field are detailed below.
108106

109107
### History Analysis
110108

111-
The history analyzer outputs a list of strings representing descriptions of how an image layer was created.
109+
The history analyzer outputs a list of strings representing descriptions of how an image layer was created. This is the only analyzer that requires a working Docker daemon to run.
112110

113111
### File System Analysis
114112

115-
The file system analyzer outputs a list of strings representing file system contents.
113+
The file system analyzer outputs a list of file system contents, including names, paths, and sizes.
116114

117115
### Package Analysis
118116

119-
Package analyzers such as pip, apt, and node inspect the packages installed within the image provided. All package analyses leverage the PackageOutput struct, which contains the version and size for a given package instance (and a potential installation path for a specific instance of a package where multiple versions are allowed to be installed), as detailed below:
117+
Package analyzers such as pip, apt, and node inspect the packages installed within the image provided. All package analyses leverage the PackageOutput struct, which contains the version and size for a given package instance (and a potential installation path for a specific instance of a package where multiple versions are allowed to be installed), as detailed below:
120118
```
121119
type PackageOutput struct {
122120
Name string
@@ -142,7 +140,7 @@ Here, the `Path` field is included because there may be more than one instance o
142140

143141
## Diff Result Format
144142

145-
The JSONs for diff results are in the following format:
143+
JSON output for diff results is in the following format:
146144
```
147145
{
148146
"Image1": "foo",
@@ -155,7 +153,7 @@ The possible structures of the `Diff` field are detailed below.
155153

156154
### History Diff
157155

158-
The history differ has the following json output structure:
156+
The history differ has the following JSON output structure:
159157

160158
```
161159
type HistDiff struct {
@@ -166,7 +164,7 @@ type HistDiff struct {
166164

167165
### File System Diff
168166

169-
The file system differ has the following json output structure:
167+
The file system differ has the following JSON output structure:
170168

171169
```
172170
type DirDiff struct {
@@ -178,7 +176,7 @@ type DirDiff struct {
178176

179177
### Package Diffs
180178

181-
Package differs such as pip, apt, and node inspect the packages contained within the images provided. All packages differs currently leverage the PackageInfo struct which contains the version and size for a given package instance, as detailed below:
179+
Package differs such as pip, apt, and node inspect the packages contained within the images provided. All packages differs currently leverage the PackageInfo struct which contains the version and size for a given package instance, as detailed below:
182180
```
183181
type PackageInfo struct {
184182
Version string
@@ -188,7 +186,7 @@ type PackageInfo struct {
188186

189187
#### Single Version Package Diffs
190188

191-
Single version differs (apt) have the following json output structure:
189+
Single version differs (apt) have the following JSON output structure:
192190

193191
```
194192
type PackageDiff struct {
@@ -198,11 +196,11 @@ type PackageDiff struct {
198196
}
199197
```
200198

201-
Packages1 and Packages2 detail which packages exist uniquely in Image1 and Image2, respectively, with package name, version and size info. InfoDiff contains a list of Info structs, each of which contains the package name (which occurred in both images but had a difference in size or version), and the PackageInfo struct for each package instance.
199+
Packages1 and Packages2 detail which packages exist uniquely in Image1 and Image2, respectively, with package name, version and size info. InfoDiff contains a list of Info structs, each of which contains the package name (which occurred in both images but had a difference in size or version), and the PackageInfo struct for each package instance.
202200

203201
#### Multi Version Package Diffs
204202

205-
The multi version differs (pip, node) support processing images which may have multiple versions of the same package. Below is the json output structure:
203+
The multi version differs (pip, node) support processing images which may have multiple versions of the same package. Below is the json output structure:
206204

207205
```
208206
type MultiVersionPackageDiff struct {
@@ -212,7 +210,7 @@ type MultiVersionPackageDiff struct {
212210
}
213211
```
214212

215-
Packages1 and Packages2 detail which packages exist uniquely in Image1 and Image2, respectively, with package name, installation path, version and size info. InfoDiff here is exanded to allow for multiple versions to be associated with a single package. In this case, a package of the same name is considered to differ between two images when there exist one or more instances of it installed in one image but not the other (i.e. have a unique version and/or size).
213+
Packages1 and Packages2 detail which packages exist uniquely in Image1 and Image2, respectively, with package name, installation path, version and size info. InfoDiff here is exanded to allow for multiple versions to be associated with a single package. In this case, a package of the same name is considered to differ between two images when there exist one or more instances of it installed in one image but not the other (i.e. have a unique version and/or size).
216214

217215
```
218216
type MultiVersionInfo struct {
@@ -224,7 +222,7 @@ type MultiVersionInfo struct {
224222

225223
## Known issues
226224

227-
To run container-diff on image IDs, docker must be installed.
225+
To run container-diff using image IDs, docker must be installed.
228226

229227

230228
## Example Run
@@ -259,8 +257,8 @@ Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
259257
Version differences: None
260258
261259
```
262-
## Example Run with json post-processing
263-
The following example demonstrates how one might selectively display the output of their diff, such that version differences are ignored and only package absence/presence is displayed and the packages present in only one image are sorted by size in descending order. A small piece of the json being post-processed can be seen below:
260+
## Example Run with JSON post-processing
261+
The following example demonstrates how one might selectively display the output of their diff, such that version differences are ignored and only package absence/presence is displayed and the packages present in only one image are sorted by size in descending order. A small piece of the JSON being post-processed can be seen below:
264262
```
265263
[
266264
{
@@ -338,7 +336,7 @@ Only in image2
338336
```
339337
## Make your own differ
340338

341-
Feel free to develop your own analyzer leveraging the utils currently available. PRs are welcome.
339+
Feel free to develop your own analyzer leveraging the utils currently available. PRs are welcome!
342340

343341
### Custom Analyzer Quickstart
344342

0 commit comments

Comments
 (0)