Skip to content

💻 Translates a Docker command line to docker-compose YAML

Notifications You must be signed in to change notification settings

raphaelyancey/cli2compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]

About

💻 Translates a Docker command line to docker-compose YAML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published