Skip to content

Template command

You can use Compose Generator to save your Docker Compose configurations for later use and to restore them. Use the template save command to save your custom configuration and load it with template load.

Info

Please note, that "templates" are something different than "predefined service templates", which you can use with the generate command. Thus, neither the list of predefined service templates of the generate command contains any templates nor the list of templates contains any predefined service templates.

Save template

Use the template load command to save custom configuration templates.

Usage

Use the save sub-command by executing:

$ compose-generator template save [template-name]

Use the save sub-command by executing:

$ compose-generator t s [template-name]

Options

You can apply following options to the save sub-command:

Option Short Description
--force -f Skip safety checks and overwrite all files, that may exist.
--stash -s Remove configuration files after saving the template.
--with-dockerfile -w Save also Dockerfile in the template.

Load template

Use the template load command to load custom configuration templates again.

Usage

Use the load sub-command by executing:

$ compose-generator template load [template-name]

Use the load sub-command by executing:

$ compose-generator t l [template-name]

Options

You can apply following options to the load sub-command:

Option Short Description
--force -f Skip safety checks and overwrite all files, that may exist.
--show -s Do not load a template. Instead only list all templates and terminate.
--with-dockerfile -w Load Dockerfile from template (if exists)