neoKushan / compose-on-unraid

Documentation on how to use docker-compose on unRAID
MIT License
7 stars 3 forks source link

Can someone use docker compose and Unraid "template-docker-containers" simulatensously? #5

Open charles-997 opened 3 years ago

charles-997 commented 3 years ago

For context, please refer to this section of your site: https://unraid.kushan.fyi/overview/benefits/#no-reliance-on-templates

I use docker-compose on a plain Ubuntu server, but I'm considering trying to run my Docker compose containers directly on Unraid. I'm pretty sure there would be no issues with using the "regular" Unraid method of docker containers (i.e. pulling templates from the community applications) in conjunction with using docker-compose based containers?

It might be good to clarify that someone can still use templates with some containers and use docker-compose for other containers. Unless of course I have gotten this mixed up, then maybe clarify that it is a one or the other choice.

Thanks for making this site, its a great contribution to the community.

neoKushan commented 3 years ago

Yeah, someone asked the same question on reddit and the short version is - there's no issue with using just compose or mixing it with the "regular" Dockerman in unRAID. They both work side by side, compose just sits on top of docker anyway.

The only slight issue is what's already highlighted in the guide about the update functionality.

I'll leave this issue open for discussion until I've added something to the guide about it. I feel an FAQ section might be worthwhile.

charles-997 commented 3 years ago

A FAQ section would be a good idea.

Another question to add to the FAQ is: Does CPU pinning work with Docker-compose containers in the same manner as it works with regular Unraid Docker containers?

neoKushan commented 3 years ago

Yup, CPU pinning is also possible, all the resource management Docker can do, compose can do as well!

It's slightly tricky as it changed between v2 and v3 of the compose spec. in v2, you can just add cpuset=0-3 (or whatever) as part of the container definition, but in v3 it's a bit tricker.

To be honest, It might actually be better for most people to stick with v2 of the spec for this reason, the discussion here adds more light on the subject: https://github.com/docker/compose/issues/4513

I'll have a think, I might rework the guide as it currently focuses on v3 but given the nature of unRAID use, v2 might be a better shout.

charles-997 commented 3 years ago

all the resource management Docker can do, compose can do as well

Huh I've been working with Docker compose for a bit now and never knew that CPU pinning was possible in native docker. I thought it was a feature Unraid had integrated into Docker. Whoops!

neoKushan commented 3 years ago

Yup, it sure is native to docker and arguably more powerful than what dockerman lets you do - https://docs.docker.com/config/containers/resource_constraints/#cpu

--cpuset-cpus is probably what you want for equivalent behaviour to "pin" specific cores, but you can adjust say --cpu-shares to give a container more or less "weight" across the cores which is probably more useful.