Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cwysong85/docker-compose-image-updater
A simple way to update all images in a docker-compose file
https://github.com/cwysong85/docker-compose-image-updater
Last synced: 10 days ago
JSON representation
A simple way to update all images in a docker-compose file
- Host: GitHub
- URL: https://github.com/cwysong85/docker-compose-image-updater
- Owner: cwysong85
- Created: 2019-05-16T21:26:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-17T01:02:45.000Z (almost 6 years ago)
- Last Synced: 2025-01-24T02:33:09.656Z (22 days ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Compose Image Updater
A simple and effective way to update image paths in an existing docker-compose.yml file.Maintaining a large docker compose file can be tedious. If you have a team of developers or have several VM's with a similiar docker compose file but with different environment variables, using this tool you can easily update only the image paths in a large docker-compose.yml file.
## Installation
```
npm i docker-compose-image-updater -g
```## Usage
```
$> dciu --helpUsage: dciu [options]
Options:
-v, --version print dciu version
-u, --update-file YAML or JSON update file to pass in
-y, --yaml-file YAML file to update, typically a docker-compose.yml file
-o, --omit-backup Do not produce a backup of the original file. Default is to backup the file e.g. docker-compose.yml.1558044602.backup
```
## Update file
The update file is a simple one-to-one mapping. The "service" name mapped to the docker "image". Below are examples files in YAML and in JSON.### --update-file YAML file syntax
Example `images-to-update.yml` file:
```
service1: nginx:1.16
service2: mysql:8.0
service3: hello-world:latest
```### --update-file JSON file syntax
Example `images-to-update.json` file:
```
{
"service1": "nginx:1.16",
"service2": "mysql:8.0",
"service3": "hello-world:latest"
}
```## Commands
This command will update a docker-compose.yml file images with new images and create a backup of the old docker compose file.
```
$> dciu -u images-to-update.yml -y docker-compose.ymlCreated backup file "docker-compose.yml.1558053560.backup"
Updated "docker-compose.yml" with new values
```To omit a backup, use the `-o` argument:
```
$> dciu -u images-to-update.yml -y docker-compose.yml -oUpdated "docker-compose.yml" with new values
```