Giter Site home page Giter Site logo

compose_plugin's Introduction

compose_plugin

compose_plugin's People

Contributors

dcflachs avatar emieldejong avatar enkows avatar leandrocoding avatar mtongnz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

compose_plugin's Issues

Support for docker-compose.override.yml

Hey, would it be possible to add support for using a docker-compose.override.yml? I did some testing to better understand process of your Plugin and have created a fix for this Problem.

But questions first:

  • Is there a reason why you call the files compose.yml and not docker-compose.yml?
  • Is there a reason why you use the -f $PATH argument? If not, running the compose up and down commands directly inside of the corresponding project folder would use the docker-compose.yml and docker-compose.override.yml by deafult.

Each docker-compose.yml file can (and should) have a corresponding docker-compose.override.yml

I need the override yaml, because I am using Mailcow which generates the docker-compose.yml based on the mailcow.conf in the project folder. But for custom changes like disabling ipv6 and adding container_name attribute and "net.unraid.docker.icon=https://..." labels for Unraid WebGUI Icons

Instead of editing docker-compose.yml directly, it is preferable to create an override file for it and implement your changes to the service there. Unfortunately, this right now only seems to work for services, not for network settings.

Trouble with stack names containing spaces

I created a stack with a name containing a space, and ran into some trouble. The "up" / "down" / "pull" buttons all work just fine, but the status indicator and log viewer don't, and the buttons in the gear menu aren't working quite right either. After some debugging, the issue seems to be that the comparison here is using $scriptName, which will have spaces in it.

I can think of a few potential ways to fix this problem:

  • run $scriptName through sanitizeStr before comparing. This is probably the lowest-effort solution.
  • leave the sanitizing up to docker-compose. Instead of using the projects/<project name>/name file and sanitizeStr, upgrade docker-compose to v2.3.4+ and use docker compose config -f projects/<project name/compose.yml --format json to see what compose thinks the project name should be (it will be the name field at the top level of the returned JSON object). This solution is attractive because there's no need to keep up with what docker-compose thinks is valid in a project name.
  • I had another idea too, but while I was writing it up I decided it was terrible so I deleted it ๐Ÿ˜„

What do you think?

Allow for variable stack root directory

I am currently migrating my docker setup to docker compose. While evaluating possibilities to manage docker compose content in Unraid I stumbled upon your project. While it is providing 99% of what I need, one thing bothers me.

Why do I have to use /boot/config/plugins/compose.manager/projects to store the docker compose content? - I would prefer having it somewhere under something like /mnt/user/docker-compose or so.

So, having a possibility to optionally define a content_base_path while adding a Stack would be great.
The commands and file name conventions for being able to show and edit the stack would stay the same.
On deletion a checkbox allowing to select if you completely want to delete the content_base_path directory would be nice, but not required.

It could be handled like the description, with a file called content_base_path holding the path to the directory of the stack docker-compose.yml.

That would allow me to combine your awesome plugin with the possibility to use a github repo storing my docker-compose data and just cloning it to the unraid pool and then continue from there.

What do you think about it?

Error if array is stopped

The following warnings appear on the Docker-Tab when the plugin is installed and the Unraid Array is stopped.

Warning: stream_socket_client(): unable to connect to unix:///var/run/docker.sock (No such file or directory) in /usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php on line 682 Couldn't create socket: [2] No such file or directory Warning: Invalid argument supplied for foreach() in /usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php on line 866

Nothing too serious, just wanted to let you know.

Issue on reboot with stack with "-" in stack name

I have a number of stacks. When I reboot, they all restart, except for 2 that have hyphen in the stack name.
image

Looking at the logs, nothing particular shows up, even after enabling debug logging.

Nov  8 21:08:58 nas01 root: Starting compose stack: plex
Nov  8 21:08:58 nas01 root: Starting compose stack: rest-server
Nov  8 21:08:58 nas01 root: Starting compose stack: scrutiny

Unraid: 6.11.2
Compose Manager: 2022.10.15

Using the Compose Up button will start the stack.

table style is not the same as the default

I'm using unRAID 6.11.1, the plugin's table style looks different from the default

The default table looks like
image

But the plugin's table looks different, with some extra spaces
image

I don't know how to build and test it on a real device, but I can try to make a pull request to help fix it

external networks show up as ID rather than name in unraid

I'm unsure who to report this to, I updated the Compose.Manager plugin this afternoon and this happens now.

docker compose up -d --build

with a compose file containing an external network that my services are attached to, results in unraid displaying the custom network id rather than the name.

Is that a this plugin problem? unraid problem? compose problem?

Update: Reinstalled version 2023.05.24, restarted the machine and its back to network name instead of id.

plugin reads every compose file while it shouldn't

I am using the compose plugin to host a borgmatic container. The file structure is as follows:

.env
docker-compose.yml
docker-compose.restore.yml

While the plugin should automatically use any docker-compose.override.yml oder compose.override.yml file, it should not use the docker-compose.restore.yml file. I had to remove the file temporarily to be able to start the container, which is a shame because it is needed in case I need to ever recover any data from my backups.

Allow global .env files

I'd like to allow global .env files. This lets me put all my settings in one file and use it accross multiple docker_compose files.

I've implemented the basics of this and will add a PR soon. Annoyingly, I had also integrated with the UI to allow this but an update wiped it out. I might re-do it but as I use code server to manage my compose files, I'm not too worried about it.

Updating Stack Fails

ENV: Unraid: 6.11.5, Compose Manager Plugin: 2022.11.17

When attempting to update a "Docker Stack", the latest images are pulled successfully, but then the following error occurs:

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount279133007/Dockerfile: no such file or directory

I checked and indeed there are no file/directory under the /var/lib/docker/tmp. That is, /var/lib/docker/tmp is empty.

The Web GUI->Docker, shows all the containers in the stack as 'not updated' (ie: the target containers in the stack has the "apply update" link.

Support for profiles?

Have you thought at all about adding support for profiles? I'd love to have a little drop-down or something to choose a profile when running compose up. I'm happy to try to put together a PR if it's a feature you might be interested in accepting.

Changes to the the icon and webui labels not upheld

This is in reference to the issue brought up in the unRAID forum
post

by Agent531C. Changes to net.unraid.docker.icon and net.unraid.docker.webui
are not reflected after running either compose up or compose down. The
reason for this is that unRAID stores all the information in the cache and does
not clear it unless 1 of 2 situations occur:

  1. When /usr/local/emhttp/state/plugins/dynamix.docker.manager/docker.json and
    its related files are deleted.
  2. The whole Docker XML templates are re-evaluated to build all the files
    (usually on a reboot).

While it would be great to implement the changes to the unRAID OS, the fact of
the matter is that docker compose is not officially supported yet. It would be
more appropriate for now to have these changes implemented as part of how
compose projects are spun up and down in this plugin. It is possible for
example, delete a project's services from the docker.json file to ensure that
webui labels are properly updated whenever a project is spun up again. For
icons, deleting the relevant image files in both
/usr/local/emhttp/state/plugins/dynamix.docker.manager/images and
/var/lib/docker/unraid/images should be sufficient to force unRAID to retrieve
the correct image.

Any chance of an update to v2.20 or later?

Thanks for producing this, it's a really convenient way to install compose replacing my manual script I used to run to install compose.

Is there any chance you could push an update to v2.20 as I'd really like to play around with the new include parameter which requires docker compose v2.20 as a minimum.

v2.21.0 is the current latest release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.