Skip to content
💻 Translates a Docker command line to docker-compose YAML
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
dist
docs
src
test
.gitignore
.npmignore
README.md
package-lock.json
package.json
webpack.config.js

README.md

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]
You can’t perform that action at this time.