Skip to content

Easily update Docker Compose Image to their latest versions.

License

Notifications You must be signed in to change notification settings

Padi2312/compose-check-updates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beschrapi Logo

Compose-Check-Updates

Easily update Docker Compose image tags to their latest versions.

compose-check-updates helps you manage and update images in Docker Compose files, similar to how npm-check-updates works for a package.json. This tool is heavily inspired by npm-check-updates and works in a similar way.

Table of Contents

Installation

Quick

  1. Download the latest Windows release from the Releases page.
  2. Run the following command to check current directory for docker compose image updates:
ccu-<YOUR_ARCHITECTURE>

Example for Windows:

ccu-windows-amd64.exe

Example for Linux:

chmod +x ccu-linux-amd64
./ccu-linux-amd64

System-wide

Windows

  1. Download the latest Windows release from the Releases page.
  2. Rename the downloaded file to ccu.exe for easier usage.
    1. (Optional) Add the file's directory to your PATH environment variable. So you can run ccu from any directory.
  3. Run ccu.exe -v from the command prompt to check if the installation was successful.

Linux

  1. Download the latest Linux release from the Releases page.
  2. Rename the downloaded file to ccu for easier usage.
  3. (Optional) Move the file to /usr/local/bin to make it available system-wide or just add it to your PATH.
  4. Make the file executable by running chmod +x ccu.
  5. Include the path to ccu in your PATH environment variable.
  6. Run ccu -v from the terminal to check if the installation was successful.

Usage

To check for updates in Docker Compose files in the current directory, run:

Check for updates only (default: only checking patch versions):

ccu

Check for updates and update the Docker Compose files:

Note

When choosing this option, ccu will create backups of the original Docker Compose files with the .ccu extension.

ccu -u

Check for updates, update the Docker Compose files, and restart the services:

ccu -u -r

You can also control the update behavior by using the flags described below.

Flags

Important

When using -i for interactive mode other arguments (except -d for directory) will be ignored.

Flag Description Default
-h Show help message false
-u Update the Docker Compose files with the new image tags false
-r Restart the services after updating the Docker Compose files false
-i Interactively choose which images to update false
-d Specify the directory to scan for Docker Compose files . (current directory)
-f Full update mode, checks updates to latest semver version false
-major Only suggest major version updates false
-minor Only suggest minor version updates false
-patch Only suggest patch version updates true

How does it work?

compose-check-updates scans the given directory for Docker Compose files. It then reads the images in the services and checks if there are newer versions available.

If newer versions are found, compose-check-updates will suggest the updated image tags. You can then choose to update the Docker Compose files with the new image tags.

Note

All subdirectories are scanned recursively for Docker Compose files.

Troubleshooting

Image tags with only x.y versions

Some images only have x.y versions and no x.y.z versions. This can lead to the following scenario:

Alpine has the following tags:

  • 3.14
  • 3.14.1
  • 3.14.0

If you are using 3.14 in your Docker Compose file, ccu will suggest an update to 3.14.1.

But for Postgres with the following tags:

  • 13
  • 13.3
  • 13.4

If you are using 13.2 in your Docker Compose file, ccu will not suggest an update to 13.4 because it's no valid semver version.

(This might be changed in the future with an additional flag)

No new versions found but there are newer versions available

On default ccu checks for patch versions only.


Example:

  • Current image tag: 1.0.0
  • Latest image tag: 1.1.0

Result: No newer patch versions available


ccu on default will not suggest an update in this case.

To check for all newer versions, use the -f flag:

ccu -f

This will suggest the latest version 1.1.0 as an update.

About

Easily update Docker Compose Image to their latest versions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages