And, as we’ll see in the next section, the output format can be customized using a template. Use case 1: generating a changelogĬontainer-diff works great for generating changelogs. Let’s see some use cases for image comparison. The command for this is: container-diff diff Container-diff really shines when comparing images. We’re only scratching the surface so far. Useradd -r -g postgres -uid=999 -home-dir=/var/lib/postgresql -shell=/bin/bash postgresĬhown -R postgres:postgres /var/lib/postgresql $ container-diff analyze -type=history postgres:14 | sed 's/ */ /g s/ /\n\t/g' The output of -type=history is hard to read, so we’ll format it with sed. ? Use -order to show files ordered by size instead of alphabetically.įinally, the history test shows the Docker layers, which roughly reflect the Dockerfile. $ container-diff analyze -type=file postgres:14 You can see every file in the image with -type=file, along with its size. $ container-diff analyze -type=pip python:3.10-bullseye ![]() Similarly, you can get a list of globally-installed packages for Node and Python with -type=node and -type=pip. $ container-diff analyze -type=apt postgres:14 Change it to -type=apt to find out which OS-level packages are installed. So, for instance, we can analyze a PostgreSQL image with: $ container-diff analyze postgres:14 Then, the contents are scanned, and a report is printed out. The tool pulls the image from the registry and unpacks the filesystem into $HOME/.container-diff/cache. The command to analyze an image looks like this: container-diff analyze Layer history: prints the commands that generated each of the layers in the image. ![]() Filesystem: shows all the files in the image and their size.Packages: shows a list of OS-installed packages (only for Debian-based distros), as well as those installed with pip and npm.Testing containersĬontainer-diff has the following test modes: The project, developed by many of the same faces behind Container Structure Tests, does a lot more than just diffing: it can analyze container images, show installed packages, and reverse-engineer the commands used to generate them. Introducing container-diffĪvailable in macOS, Linux, and Windows, container-diff (like the name suggests) is diff for container images. So, let’s elaborate a bit more in our container-diff tutorial. Fortunately, where there’s a need, there’s a tool. But change is inevitable, and while commits on Dockerfiles are easy to control, the impact of those changes on the resulting image are not. We know that an innocent-looking change can have branching, hard-to-debug consequences. The coloration and UI is nice too.Touching a working Dockerfile can feel like playing with fire. I like that I can have different projects for each codebase. I use it often for folder and file diffs. What are some of the coolest/most useful programs to have in 2022? BeyondCompare is a tool I love for comparing configuration files or t directory trees.įavorite source code comparison tool / diff tool?. ![]() My best guess (and I'm still not sure but taking an educated guess) at what happened is, while I was deleting, I accidentally selected *both* the left and right sides, instead of just the. Ugh, ok, I feel pretty stupid but, I was messing around with Beyond Compare (a nice piece of software that I highly recommend, btw) comparing my internal drive with an incomplete backup thereof, trying to delete duplicates. It costs money but it's worth it - both Windows AND Linux versions. However a nice GUI program: Beyond Compare from Scooter Software is a native Windows app that will compare entire subdirectories or even entire disks and will show a GUI of changes / mods / missing / extra files. How to verify that the files are copied without problems?Ĭhecksums are better long term. ![]() I can highly recommend BeyondCompare from. Best tools to show the difference in files between two cloned drives?
0 Comments
Leave a Reply. |