container-diff | container-diff : Diff your Docker containers | Continuous Deployment library
kandi X-RAY | container-diff Summary
kandi X-RAY | container-diff Summary
container-diff is a tool for analyzing and comparing container images. container-diff can examine images along several different criteria, including:. 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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of container-diff
container-diff Key Features
container-diff Examples and Code Snippets
Community Discussions
Trending Discussions on container-diff
QUESTION
Trying to figure out a way to replace a value from one file with the value of another using bash or awk or grep whichever is easiest.
Example:
File 1 - contains a list of all docker container images running on a node so:
docker/container-name:123456
docker/anothercontainer-differentname:7841216
File 2 - is a docker compose file in json format with a field named "image:" that contains values like this:
image: docker/container-name:latest
image: docker/anothercontainer-differentname:latest
What would be the best way to compare the two files and get the values from File 1 after the tag ":" for the matching name and replace that value in File 2 "latest" so that File 2 now shows
image: docker/container-name:123456
...ANSWER
Answered 2017-Aug-15 at 20:12Ok I have something that works on the yaml file. It is a little bit hacky I must say.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install container-diff
In order to quickly make your own analyzer, follow these steps:. The image arguments passed to your analyzer contain the path to the unpacked tar representation of the image, as well as certain configuration information (e.g. environment variables upon image creation and image history). If using existing package tools, you should create the appropriate structs (e.g. SingleVersionPackageAnalyzeResult or SingleVersionPackageDiffResult) to analyze or diff. Otherwise, create your own structs which should yield information to fill an AnalyzeResult or DiffResult as the return type for Analyze() and Diff(), respectively, and should implement the Result interface, as in the next step. This is where you define how your analyzer should output for a human readable format (OutputText) and as a struct which can then be written to a .json file. See util/diff_output_utils.go and util/analyze_output_utils.go.
Determine if you can use existing analyzing or diffing tools. If you can make use of existing tools, you then need to construct the structs to feed into the tools by getting all of the packages for each image or the analogous quality to be analyzed. To determine if you can leverage existing tools, think through these questions:
Are you trying to analyze packages? Yes: Does the relevant package manager support different versions of the same package on one image? Yes: Implement getPackages to collect all versions of all packages within an image in a map[string]map[string]util.PackageInfo. Use GetMultiVersionMapDiff to diff map objects. See differs/node_diff.go or differs/pip_diff.go for examples. No: Implement getPackages to collect all versions of all packages within an image in a map[string]util.PackageInfo. Use GetMapDiff to diff map objects. See differs/apt_diff.go. No: Look to History and File System differs as models for diffing.
Write your analyzer driver in the differs directory, such that you have a struct for your analyzer type and two methods for that analyzer: Analyze for single image analysis and Diff for comparison between two images:
Create a struct following the Result interface by implementing the following two methods.
Add your analyzer to the Analyzers map in differs/differs.go with the corresponding Analyzer struct as the value.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page