GithubHelp home page GithubHelp logo

bucherfa / docker-compose-converter Goto Github PK

View Code? Open in Web Editor NEW
16.0 0.0 2.0 20 KB

Convert docker run/create commands to docker-compose.yml files.

License: GNU General Public License v3.0

JavaScript 100.00%
docker run create docker-compose docker-compose-converter converter

docker-compose-converter's Introduction

docker-compose Converter

Convert docker run/create commands to docker-compose.yml files.

Online Demo

Example

Input

docker run -d \
  -v nextcloud:/var/www/html \
  nextcloud
docker run -d \
  -v db:/var/lib/mysql \
  mariadb

Output

version: '3'
services:
  nextcloud:
    image: nextcloud
    volumes:
      - 'nextcloud:/var/www/html'
  mariadb:
    image: mariadb
    volumes:
      - 'db:/var/lib/mysql'

Usage

Install

npm install docker-compose-converter --save

Include

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);

docker-compose-converter's People

Contributors

bucherfa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jtagcat huagcs

docker-compose-converter's Issues

docker container?

Hi,
can you please add docker container option? so it have be self hosted?
thanks

--detach==true cannot be handled correctly

The conversion handles -d fine, but not --detach=true, which is the same thing.

Here's a test command: docker run --detach=true -v nextcloud:/var/www/html nextcloud.

The current result is:

version: '3'
services:
  nextcloud:
    image: nextcloud
    volumes:
      - 'nextcloud:/var/www/html'
    command: '--detach=true'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.