Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mlsmithjr/container2cli
https://github.com/mlsmithjr/container2cli
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlsmithjr/container2cli
- Owner: mlsmithjr
- Created: 2021-04-22T19:43:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-23T12:49:50.000Z (over 3 years ago)
- Last Synced: 2024-08-01T12:22:14.810Z (3 months ago)
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## container2cli
This utility allows you to generate docker cli commands or a compose file to recreate your containers.
This is helpful when you have existing containers and no existing shell script or compose file, or you want to move to using docker-compose.Be aware that this tool exports all environment variables assigned to a container.
This includes some defined in the container itself and not by the user.
It attempts to filter out some "cruft" but there is no way to know which env settings were created by the user.
If you wish to add your own then edit the _filters_ list at the top of the script.It is a work in progress and feedback/pull requests are appreciated.
### Install:
Clone this repo, then in a shell or command prompt:
```shell
pip3 install -r requirements.txt
```
**Currently does not run on Synology, but you can connect to one using --host**### Usage:
container2cli.py [--host <_host ip:port>_] [--compose | --cli] <_container name_> ...**--host**, optional. If given, will remote-connect to the specified Docker instance. If omitted, will default to the host being run on.
**--compose**, generate a docker-compose file
**--cli**, generate shell scripts (default)
**container name**, one or more container names to export
### Examples:
```shell
python3 container2cli.py sonarr nzbget tautullipython3 container2cli.py --host homeserver:2375 --compose sonarr radarr portainer
```