docker compose?


Recommended Posts

i recently moved most of my containers to docker-compose+portainer, and it works great.  did i have to?  no.  but like everything else unraid, tinkering around is itself enough of a reason.

 

nonetheless, using docker-compose is more than just having a CLI.  some other benefits:

  • you can configure multiple images holistically.  instead of individually configuring telegraf, influxdb, grafana, you could do all 3 in a single YAML file.  you can spin up/down the whole "stack" (as portainer calls it) together.
  • less restrictions.  dockerMan only lets you configure a subset of available features.
  • it's standard.  you can share your YAML file with others, and vice-versa with or without unraid.  and since this comes from docker itself, it will be supported well into the future.

 

the only downside i've seen so far in this setup, is that obviously a lot of things assume you only configure docker containers with dockerMan.  yesterday i got a warning from "fix common problems" that my templates for some containers were wrong -- well that's because i deleted them since they were no longer needed.

 

edit 1: another downside...if you restart the docker service (reboot, restart array, etc), all the containers will use the settings defined in dockerMan.  this means volume mounts, environment variables, could be wrong/missing.

 

edit 2: if you use dockerMan to pull down new images and restart the container, it will use what's defined in the template and "detach" it from the compose configuration.  if you try to apply the docker-compose.yml afterwards, it'll complain that one of the services already exist. you have to delete it from dockerMan, and then docker-compose can recreate it.

Edited by bling
  • Like 2
Link to comment
  • 1 month later...
On 2/8/2020 at 4:04 PM, Squid said:

Not going to argue with the basic points, but dockerMan will let you configure everything possible.  The extra parameters section on the template.

The problem is when you have something like this

https://github.com/mailcow/mailcow-dockerized/blob/master/docker-compose.yml

It would be nice to have in dockerman a way to configure something the way docker compose does it, as a group.

In the UI all the dockers could be nested in only one, and lets say you will configure all the dockers in the same template. It should be hard since more changes are in the UI.

Somehow dockerman teamplates could be as a dockercompose yml

  • Like 1
Link to comment
On 2/8/2020 at 4:04 PM, Squid said:

Not going to argue with the basic points, but dockerMan will let you configure everything possible.  The extra parameters section on the template.

https://github.com/librenms/docker/blob/master/examples/compose/docker-compose.yml

How do I configure this in the same IP? I don't think you can reproduce any configuation that easily en dockerman. How can I setup the cron Image.

Link to comment
  • 3 weeks later...

I hear all the people claim docker-compose is available persistently in nerd-tools, and maybe I'm just blind but I cant find it there (or in the dev tools pack) for my live.

 

According to what I see my Nerdtools plugin is up to date.

 

I guess I can live with an Install script running every start, but I'm all for not needing to do that unless really necessary.

 

Also, that aside, IMAO its time that unraid supports docker-compose. Because as it is the Unraid UI promotes bad practices because of lack of integration. To give an example, many containers require a seperate mysql instance, and people thus get the Template from Community application that exposes its interface on the host. Thats both bloating up the ports already in use and a security risk.

 

Docker-Compose with its file-defined networks meanwhile allows you to not expose any ports to the mysql container at all.

 

Yeah you can work around the issues, but as a matter of fact its not easy to do and comes with other headaches, and thus people generally dont do it.

Edited by 9smtm6
Add some comments on the situation
  • Like 2
Link to comment
  • 3 weeks later...

As docker's --link option is decrepated, we're no longer able to use multi-container apps like owncloud. Their only approach is now via compose.

Am I wrong here?

 

Also: people arguing that compose "is just a command line tool", while docker works in somewhat of the same way. It's a service with a CLI and some people built gui's, like the unraid guys. There are gui projects for compose going on outthere. No reason why the Unraid team shouldn't see this as a future project. 😉

 

And docker-compose is no longer available in the nerdpack. As I try not to mess with my unraid system via command line tampering, I'm reluctant to move to compose. So now I'm getting more & more restricted in what container images I can use...

Edited by Osiris
  • Like 1
Link to comment
23 hours ago, Osiris said:

As docker's --link option is decrepated, we're no longer able to use multi-container apps like owncloud. Their only approach is now via compose.

Am I wrong here?

Luckly you are wrong here. Multi Container Apps can be achieved using dockerman, its just not as straight forward to do as with other tools. You will have to manually create the docker networks required for the application, but once created they are available as a network option in the dockerman interface.

 

23 hours ago, Osiris said:

And docker-compose is no longer available in the nerdpack. As I try not to mess with my unraid system via command line tampering, I'm reluctant to move to compose.

Additionally there are other methods of getting compose on unRAID for instance I recently saw this intriguing post by @Thx And Bye.

 

23 hours ago, Osiris said:

So now I'm getting more & more restricted in what container images I can use...

 There are also other GUI based docker managers that exist that would allow you to utilize the more advanced features of docker. https://www.portainer.io/ for instance runs within a docker container itself, thus could be used on unRAID without any command line setup.

 

23 hours ago, Osiris said:

Also: people arguing that compose "is just a command line tool", while docker works in somewhat of the same way. It's a service with a CLI and some people built gui's, like the unraid guys. There are gui projects for compose going on outthere. No reason why the Unraid team shouldn't see this as a future project.

Finally just a thought on limetech's motivations here. Note I am not associated with them or privy to their priorities of plans. My guess though would by that supporting more advanced container configurations, either via dockerman or by integrating something like compose is quite a ways down their priority queue. Likely because early on, when docker was introduced on unRAID as the primary avenue to install applications, the unRAID community began to create and coalesce around fat containers that package all processes required for a particular application stack. I have no interest in arguing container design philosophy, I just mean to point out that by and large the containers most prevalent on unRAID are likely those created by the unRAID community, which tend to be single container applications.

  • Like 1
Link to comment
  • 2 weeks later...
  • 10 months later...
3 hours ago, Glassed Silver said:

One BIG upside to supporting docker-compose would be a heavily decreased "reliance" on software stacks being bundled into unRAID-specific (and hence barely ever official or verified) images.

Not arguing against docker-compose, but as a general rule, docker is docker is docker, and there aren't really any "Unraid Specific" images present.

  • Like 1
Link to comment
10 hours ago, Squid said:

Not arguing against docker-compose, but as a general rule, docker is docker is docker, and there aren't really any "Unraid Specific" images present.

Yes there is...

(edit: well... sure they would run in other setups other than unRAID as well, but on others they wouldn't exist, because you'd just use docker-compose to setup the stack...)

 

There is unRAID-specifically bundled images that are only bundled as ONE image, because the "stack" as Portainer calls is not natively supported from within the UI.

 

The UI that we praise - for good reasons - to have upsides to Portainer like nice metadata presentation, icons, easy updates, better handling of appdata management, etc...

 

If you want the simplicity of unRAID for its way to handle Docker images you ARE limited in quite some ways, unless you make your own stack, bundle it up as your own template and then feed it into unRAID.

 

unRAID may technically support it all, but I'm not arguing the technical design, I'm arguing the UI design.

If you mix Portainer and DockerMan you're entering unsupported land and on top of it the stuff Portainer creates looks out of place in DockerMan.

 

THAT is what I'm arguing.

 

For all I care LimeTech could only offer recognition of stacks created in a Portainer container by reading its config or something and then just present it differently in DockerMan, maybe offer up to apply a "mask" to it, so you manually feed the stack a support link, icon and some description.

 

I don't know, I'm not an engineer, but what I can say is that the typical unRAID user probably doesn't want to mess with two UIs battling each other. (DockerMan vs. Portainer)

 

So yes, docker is docker is docker.

 

But docker on unRAID is docker + DockerMan which is not JUST docker. Unless you want to completely ignore DockerMan you are going to not have a same same experience just like you would have on a vanilla Ubuntu Server for example where you just toss your docker service and install portainer and docker-compose your way to satisfaction. (but without the niceties of DockerMan!)

Edited by Glassed Silver
  • Like 1
Link to comment

I see both sides to this. DockerMan is essentially just a UI on top of docker with some additions to make it a little more user friendly but ultimately it's going to run the same docker containers under the hood.

 

It would be nice if DockerMan was a little less unRAID specific. One way of doing that would be for it to store its metadata as docker labels instead of whatever it's doing to store that XML data now - there's a feature request here for this exact suggestion.

 

It would then give you the best of both worlds by allowing you to manage your containers using whatever methods you like, while still leveraging the DockerMan dashboard and niceties that it brings. 

Link to comment
  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

Hey, I am using docker-compose on my Unraid system, too. I installed it manually via curl and everything is working as expected.

 

But after a reboot docker-compose is gone. For sure I added the installation to my boot config:

 

root@nas:# cat /boot/config/go

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &

# add the following lines to /boot/config/go on your unRAID server.
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

 

How can I find out what the problem is?

Link to comment

@Squid ok that is a good point... thanks for that! Manually it just works. Any idea how to get it fixed? Maybe some kind of "sleep" in the script?

 

Maybe I will just try to use the "User Sripts" Plugin instead of the boot config script. I suppose it should work when creating a script running "At first Array start only". Any experience with this workaround solution (or any other workarounds)?

Link to comment
  • 2 weeks later...

This is what I did with "user scripts"

  1. Created as script, that's simply a place holder for the docker compose binary. In my example it's called "06_docker_compose_binary". Just create it in the web ui. Add nothing.
  2.  A script that downloads the docker-compose binary, once a month, into the place holder script created in step one:
#!/bin/bash
#----------------------------------------------------------------------------
# This script will update docker-compose script from github periodically    |
#----------------------------------------------------------------------------

COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /boot/config/plugins/user.scripts/scripts/06_docker_compose_binary/script

 

3. Add to /boot/config/go file:

 

# COPYING DOCKER-COMPOSE ##########
cp /boot/config/plugins/user.scripts/scripts/06_docker_compose_binary/script /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
###################################

 

That's it!

It's updated regularly and doesnt need internet on server start.

 

Hope it helps.

 

 

 

 

 

 

 

 

 

Edited by juan11perez
  • Thanks 1
Link to comment
  • 2 months later...
On 7/10/2021 at 5:24 PM, juan11perez said:

This is what I did with "user scripts"

  1. Created as script, that's simply a place holder for the docker compose binary. In my example it's called "06_docker_compose_binary". Just create it in the web ui. Add nothing.
  2.  A script that downloads the docker-compose binary, once a month, into the place holder script created in step one:
#!/bin/bash
#----------------------------------------------------------------------------
# This script will update docker-compose script from github periodically    |
#----------------------------------------------------------------------------

COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /boot/config/plugins/user.scripts/scripts/06_docker_compose_binary/script

 

3. Add to /boot/config/go file:

 

# COPYING DOCKER-COMPOSE ##########
cp /boot/config/plugins/user.scripts/scripts/06_docker_compose_binary/script /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
###################################

 

That's it!

It's updated regularly and doesnt need internet on server start.

 

Hope it helps.

 

 

 

 

 

 

 

 

 

Juan, you're a hero.

Link to comment
  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.