Coder Social home page Coder Social logo

cli2compose's Introduction

npm CircleCI

cli2compose

Translates

docker create \
  --name=nextcloud \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -p 443:443 \
  -v :/config \
  -v :/data \
  --restart unless-stopped \
  linuxserver/nextcloud

into

version: "2"
services:
  app:
    image: linuxserver/nextcloud
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    ports:
      - 443:443
    volumes:
      - :/config
      - :/data
    restart: unless-stopped

Quick start

npx -q cli2compose docker run mariadb > docker-compose.yml

... or through the web ui!

Usage

CLI

npx -q cli2compose docker run mariadb > docker-compose.yml

Node.js

const cli2compose = require('cli2compose');
const yaml = cli2compose('docker run mariadb');
console.log(yaml);

Browser

<script src="https://unpkg.com/cli2compose"></script>
<script>
    console.log(cli2compose('docker run mariadb'));
</script>

Supported input options

docker [create|run] [--volume|-v]
                    [--publish|-p]
                    [--network|--net]
                    [--restart]
                    [--expose]
                    [--env|-e]
                    [--links]
                    [--name] image [command]

cli2compose's People

Contributors

raphaelyancey avatar

Stargazers

ไฟฎๆ˜Š avatar Martin Desrumaux avatar

Watchers

James Cloos avatar  avatar

cli2compose's Issues

Parsing

docker run --name elasticsearch -e "http.host=0.0.0.0" -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" -d docker.elastic.co/elasticsearch/elasticsearch-oss:6.6.1

results in

version: "2"
services:
  app:
    image: -X
    command: -m -x -5 -1 -2 -m -"
      docker.elastic.co/elasticsearch/elasticsearch-oss:6.6.1
    container_name: elasticsearch
    environment:
      - '"http.host=0.0.0.0"'
      - '"ES_JAVA_OPTS=-Xms512m'

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.