image-trans-cli is a command-line tool for managing Docker images. It supports pulling images from a source registry, tagging images, and pushing them to a target registry.
- Pull images from a source registry
- Tag images with a new repository
- Push images to a target registry
-
Ensure that [Go] and [Docker] are installed on your system.
-
Clone this repository:
git clone https://github.com/Firstnsnd/image-trans-cli.git cd image-trans-cli -
Build the project:
make build
Alternatively, if you want to build for Windows:
make build-windows
-
Copy the compiled binary to your PATH, or use it directly in the current directory.
Create a YAML configuration file (e.g., config.yaml) with the following format:
images:
- nginx:latest
- redis:6
target: my-registry.comBefore pushing images to the target registry, please ensure that you have sufficient permissions to perform the following actions:
- Login to the target registry:
docker login my-registry.com
- Ensure that your account has permissions to push images.
- If using CI/CD tools, make sure the related permissions are configured correctly.
Run the tool and specify the configuration file:
./image-trans-cli -c config.yaml| Argument | Description |
|---|---|
| -c, --config | Path to the YAML configuration file (required) |
| -v, --verbose | Enable verbose output |
| --dry-run | Preview actions without executing them |
- Process the images from the configuration file:
./image-trans-cli -c ./config.yaml
- Enable verbose output:
./image-trans-cli -c ./config.yaml -v
- Perform a dry run (preview actions):
./image-trans-cli -c ./config.yaml --dry-run
After processing is complete, the program will display the results, including statistics of successful and failed image transfers.
If you would like to contribute to this project, please create a new branch, make your changes, and submit a Pull Request.
This project is licensed under the MIT License. For more details, please see the LICENSE file.