Home

Awesome

decomposerize

Netlify Status npm ShareVB on GitHub

http://decomposerize.com - Turns docker-compose file into docker run commands!

Looking for the reverse : http://composerize.com / Composerize

Want to convert from Docker compose file formats : http://composeverter.com / Composeverter

CLI

decomposerize can be run in the cli.

npm install decomposerize -g to install, and run as such:

$ decomposerize << docker-compose.yml

API

convertToDockerRunCommands(dockerComposeContent, configuration={})

returns

It returns the Docker run command(s) generated based on the input Docker Compose file and the provided configuration

How to use with node.js

Make sure to install the composerize package in your project by running:

npm install decomposerize

With the following code, you can easily integrate Decomposerize into your Node.js project and generate Docker run command(s) from Docker Compose configurations.

const convertToDockerRunCommands = require('decomposerize');

const dockerComposeInput = `
version: '3'
services:
  myapp:
    image: myapp-image
`;

const configuration = {
  command: 'docker run',
  rm: true,
  detach: false,
  multiline: true,
  'long-args': false,
  'arg-value-separator': ' ',
};

const dockerRunCommands = convertToDockerRunCommands(dockerComposeInput, configuration);

console.log('Generated Docker Run Commands:');
console.log(dockerRunCommands);

Contributing

Maintainers