omv6:omv6_plugins:compose

This is an old revision of the document!



Compose Plugin For OMV6

Compose Plugin For OMV6



  • The openmediavault-compose plugin provides a tool in the openmediavault GUI to create and manage containers using docker-compose.
  • Two management methods are provided, via yaml files or via dockerfiles.
  • All generated files (yaml, env, dockerfiles, …) are stored in a user-defined folder.

In OMV6's GUI:
Under System > Plugins find and highlight openmediavault-compose 6.X, and click the Install button.

  • Installing openmediavault-compose will also install docker on the system if it was not already installed.

Under Services > Compose > Settings

Shared folder

Select a shared folder where to store the files generated by the user in the plugin (for didactic purposes in this guide we will call it “compose”).

A common practice for creating docker containers is to use a yaml composition file to define the parameters and docker-compose will generate the container(s) defined in this file.

Many container builders will provide composition yaml files to implement the container. This file must be adapted to the characteristics of your server. Consult the documentation of the creator of the container in each case to know how to do it.

In the same way you can define an env file where environment variables are included.

Files Lists the yaml and env configuration files created, whether the containers are running or stopped.

Selecting a file activates the buttons on the top bar.

Allows you to act on the container or containers defined in a yaml file simultaneously.

Under Services > Compose > Files

Create

Allows you to create the yaml and env configuration files of a container. Pressing the button will open a dialog window with the following fields:

  • Name Name with which this file will be designated in the system.
  • Description Description of the file to help identify it.
  • File Here you can create (or copy and paste) the configuration yaml file for the container(s).
  • Environment Here you can create (or copy and paste) the environment variable env file of the container(s).
  • Save It will store the created yaml and env files in a subfolder of the “compose” folder, this subfolder will be given the name written in the “name” field. You will exit the dialog window. The created file will now appear on a line with the name on the left and the description on the right. Selecting this line will activate all the buttons to apply actions to this file.
  • Cancel Exit without saving changes.

Add from example

Allows you to create example wrappers from preconfigured yaml files in the plugin.

  • Example You can select a yaml file from the list.
  • Name Name with which this file will be designated in the system.
  • Description Description of the file to help identify it.
  • Save Will set up the sample yaml and env files so that they can be edited and adapted to the server environment.
  • Cancel Exit without saving changes.

Autocompose

Allows you to create yaml configuration files from containers running on the system that have not been created with compose. Use only when necessary, the generated file will be much larger than necessary to deploy a container. Useful if you have lost the configuration data of a container created in the CLI.

  • Container A list of working containers that can be imported into the compose plugin will appear.
  • Name Name with which this container will be designated in the system.
  • Description Description of the container functions to help identify it.
  • Version The version of the docker yaml composition files that will be used to create the configuration file.
  • Create It will generate the yaml and env files and store them in the “compose” folder inside the corresponding subfolder.
  • Cancel Exit without saving changes.

Edit

Triggered by selecting a yaml file. Allows you to edit the yaml and env files of the selected file. The window is the same as the Create button already seen.

Delete

It is activated when selecting a file. Allows you to delete a file. The corresponding subfolder in “compose” along with the yaml and env configuration files will also be removed.

Check

It will check the configuration of a file and report possible errors if they are detected. Util before launching the defined container or containers. Any error that appears in a red box can be copied to the clipboard from the notifications button in the top bar of OMV to read it in its entirety.

Up

Triggered by selecting a yaml file. Allows you to display the containers belonging to the selected yaml file. If this is the first time, the container images will be downloaded, then the containers defined in the file will be put into operation.

Down

Activates when selecting a file. Allows you to stop the containers defined in the selected file.

Pull

Activates when selecting a file. Allows you to download the latest images available on the internet from the containers defined in the selected file. Previous images are still on the system.

ps

Activated when selecting a file. Allows you to see in a pop-up window the status of the containers defined in the selected file.

Prune

Allows you to clean the system of images, containers, volumes or networks that are no longer needed and recover space.

  • System Removes from the system any images, containers, volumes, or networks generated for containers that no longer exist in the openmediavault-compose GUI or are not used. It does the same as all the following buttons simultaneously.
  • Image Removes downloaded container images from the system that no longer exist in the openmediavault-compose GUI or are not used.
  • Container Removes from the system containers that no longer exist in the openmediavault-compose GUI or are not used.
  • Volume Removes from the system volumes that no longer exist in the openmediavault-compose GUI or are not used.
  • Network Removes container network interfaces from the system that no longer exist in the openmediavault-compose GUI or are not used.

Docs

Link to this guide.

Containers can be created using a dockerfile. This dockerfile defines the image that the container will use and will execute a series of commands that will lead to the generated container running.

Dockerfiles lists the configuration dockerfiles generated to create containers, whether they are running or stopped.

Selecting a dockerfile activates the buttons on the top bar.

The operation is similar to Files, but the containers are created using dockerfiles.

Under Services > Compose > Dockerfiles

Create

Popup window to create a container using a dockerfile.

  • Name Name with which this dockerfile will be designated in the system.
  • Description Description of the dockerfile functions to help identify it.
  • Dockerfile Here you can create (or copy and paste) the dockerfile for container creation.
  • Script filename Name of the file with the script.
  • Script Optionally here you can create (or copy and paste) a file with a script that will call dockerfile when run.
  • Conf filename Name of the file with the environment parameters.
  • Conf file Optionally here you can create (or copy and paste) a configuration file to be included within the image.

Edit

Triggered by selecting a dockerfile. Allows you to edit the dockerfile, script, and conf files of the selected container. The window is the same as the Create button already seen.

Delete

Triggered by selecting a dockerfile. Allows you to delete a container. The corresponding subfolder in “compose” along with the dockerfile, script and conf configuration files will also be removed.

Build

Activated by selecting a dockerfile. It allows deploying the container following the dockerfile already configured.

Shows a list of running containers displaying the basic execution data.

Selecting a container activates the buttons on the top bar.

It allows acting on the containers individually.

Under Services > Compose > Containers

Pull

Activated by selecting a container. Allows you to download the latest image of the selected container available on the internet. The behavior is the same as in Files but only the image of the selected container is downloaded, not all the containers that have been generated by the yaml file.

Up

Activates when selecting a container. Allows you to display the selected container. The behavior is the same as Files but only the selected container will be started, not all the containers that have been generated by the yaml file.

Restart

Activated when selecting a container. Allows you to restart the selected container.

Logs

Activated when selecting a container. Allows you to view the log of the selected container.

Shows a list of running containers displaying the usage status of the resources used.

Selecting a container activates the buttons on the top bar.

Under Services > Compose > Stats

Inspect

Docker inspect provides detailed information about builds controlled by Docker.

Logs

Activated when selecting a container. Allows you to view the log of the selected container.

There are three widgets on the dashboard that provide docker container information:

  • Services Grid Shows if docker is enabled and running by a green button.
  • Services Table Shows in a list if docker is enabled and running.
  • Container Table Shows a list with the name of each container that is running, the image used by that container, and the time it has been running. Stopped containers do not appear in this table.

How to implement a container using a yaml file

  • If you have not already done so, define the folder where to store the configuration files. Go to Services > Compose > Settings In the dropdown choose a shared folder and click Save.
  • Go to Services > Compose > Files Click on Create.
  • Copy and paste your configuration yaml file into the File window.
  • Fill in the Name field with a name for the file.
  • Optionally type a description of the file in the Description field.
  • Optionally copy and paste your environment parameter file into the Environment window.
  • Press Save.
  • Press the Up button. The image(s) of the container(s) defined in the yaml file will be downloaded and those containers will be put into operation.

How to update a single docker-compose container

  • Go to Services > Compose > Containers and select the container you want to update.
  • Press the Pull button. This will download the latest available image from that container.
  • Now go to Services > Compose > Files and select the file where that container is defined.
  • Press Down. Containers defined in the yaml file will be stopped.
  • Click Up. The containers defined in the yaml file will start with the latest available image downloaded. Your container is already updated.
  • Press Prune and then press Image. Old images will be deleted.

How to update multiple containers defined in a single docker-compose yaml file

  • Go to Services > Compose > Files and select the yaml file that defines the containers you want to update.
  • Press the Pull button. This will download the latest images available from all containers defined in the yaml file.
  • Click Down to stop the containers defined in that yaml file.
  • Click Up. The containers defined in the yaml file will be started with the latest available image downloaded from each container. Your containers are already up to date.
  • Press Prune and then press Image. Old images will be deleted.

How to delete containers from a yaml file

  • Go to Services > Compose > Files and select the yaml file that defines the containers you want to remove.
  • Click Down to stop the containers defined in that yaml file.
  • Press Prune and then press System. All data generated by those containers will be removed from the system.
  • If you want to delete the yaml file, click Delete. This will remove the yaml file.

How to deploy a container using a dockerfile

  • If you have not already done so, define the folder where to store the configuration files. Go to Services > Compose > Settings In the dropdown choose a shared folder and click Save.
  • Create the dockerfile composition file: Go to Services > Compose > Dockerfiles Click on Create.
    • Copy and paste your configuration dockerfile into the dockerfile window.
    • Fill in the Name field with a name for the dockerfile.
    • Optionally type a description of the dockerfile in the Description field.
    • Optionally copy and paste your script file into the Script window so that the dockerfile can execute it. Write the name of this file in the Script filename field.
    • Optionally copy and paste your environment parameter file into the Conf file window so that it is included in the generated image. Write the name of this file in the Conf filename field.
    • Press Save.
  • Create the container and run it:
    • Select the dockerfile and press the Up button. The container will be created with the dockerfile commands and that container will be put into operation.

We, who support the openmediavault project, hope you’ve found this guide to be useful and that you’ll find your openmediavault server to be efficient, easy to use, and enjoyable.

If you found this plugin guide to be helpful, please consider a modest donation to support the hosting costs of this server.

OMV-Extras.org



Venmo: ryecoaaron

  • omv6/omv6_plugins/compose.1683423713.txt.gz
  • Last modified: 2023/05/07 01:41
  • by chente