Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bucherfa/docker-compose-converter
Convert docker run/create commands to docker-compose.yml files.
https://github.com/bucherfa/docker-compose-converter
converter create docker docker-compose docker-compose-converter run
Last synced: about 1 month ago
JSON representation
Convert docker run/create commands to docker-compose.yml files.
- Host: GitHub
- URL: https://github.com/bucherfa/docker-compose-converter
- Owner: bucherfa
- License: gpl-3.0
- Created: 2019-06-16T14:14:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T23:21:28.000Z (about 4 years ago)
- Last Synced: 2024-09-22T14:02:14.932Z (about 2 months ago)
- Topics: converter, create, docker, docker-compose, docker-compose-converter, run
- Language: JavaScript
- Size: 19.5 KB
- Stars: 17
- Watchers: 0
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-compose Converter
Convert docker run/create commands to docker-compose.yml files.
[Online Demo](https://bucherfa.github.io/dcc-web/)
## Example
### Input
```bash
docker run -d \
-v nextcloud:/var/www/html \
nextcloud
docker run -d \
-v db:/var/lib/mysql \
mariadb
```### Output
```yml
version: '3'
services:
nextcloud:
image: nextcloud
volumes:
- 'nextcloud:/var/www/html'
mariadb:
image: mariadb
volumes:
- 'db:/var/lib/mysql'
```## Usage
### Install
```bash
npm install docker-compose-converter --save
```### Include
```javascript
const dcc = require('docker-compose-converter');
const dockerRunCommands = `
docker run -d \
-v nextcloud:/var/www/html \
nextcloud
docker run -d \
-v db:/var/lib/mysql \
mariadb
`;
const dockercomposeyml = ddc(dockerRunCommands);
console.log(dockercomposeyml);
```