Closed hipstersmoothie closed 2 years ago
More Context: Seems to only error out when I provide a file path?
Here I try what I saw in other issue in this repo and have the config files outside of the container.
services:
airconnect:
image: 1activegeek/airconnect:latest
container_name: airconnect
restart: always
network_mode: host
environment:
- AIRCAST_VAR='-x /config/airconnect.xml'
volumes:
- /home/andrew/config:/config
And you can see here it runs fine when running in the container manually
Interesting. Thanks for the ☕ BTW! My first 2 guesses would be permissions and/or formatting in the compose file. Just for giggles, can you try using a raw Docker command vs the compose and see if it has the same issues? So just drop into the term and use: docker run -d -e AIRCAST_VAR="-x /config/airconnect.xml" --net=host 1activegeek/airconnect
and see what you come up with. I'll try and re-create on my own in the next day or so.
Oh and also, if you can - upload what you have in the airconnect.xml file (bleep out anything sensitive if necessary) and snap a quick view of the permissions in the folder its running from. Based on it having worked from inside the container tells me it shouldn't be the config, and it shouldn't be permissions. But permissions can still be a little whacky in docker and something else could be at play fixing the perms once the container launches vs prior to where the compose is erroring in its execution.
So I ran this:
sudo docker run -d -e AIRCAST_VAR="-x /config/airconnect.xml" --net=host -v '/home/andrew/config':'/config' 1activegeek/airconnect
and it worked. But running docker-compose up airconnect
I still get the same issue.
I don't really think it's the config file at this point but here is mine:
Here are the permissions for the config folder:
Ok, so if it worked using the raw socket run command, then it's likely something to do with the compose file. Have you tried using " instead of ' for the variable?
EDIT: On second thought, try it with no quotes at all as well. I'm forgetting how this went, but I think the YAML was ok with spaces and such, as long as you don't put a new line char in there it should be fine. I just references some other compose file I have with ENV variables and I have NO quotes around them
Hey just checking in - any luck here? I should be able to make a mock up enviro to test on my own on Thur. Been a bit tied up with a training at work. Ends Thur, but I'll have more time overall as well. Let me know if it's still showing up with an issue.
@hipstersmoothie were you able to try the suggestion above? And/or did you get it working? I hadn't gotten a chance to check it out myself. If don't hear back by weekend, I'll close this out. You can always come back and re-open I believe if you're able to test further.
Closing due to stale status.
Just ran into the same problem and the solution is to put the whole environment statement into quotes, like below:
services:
airconnect:
container_name: airconnect
image: "1activegeek/airconnect"
restart: unless-stopped
privileged: true
network_mode: host
volumes:
- ./config:/config/airconnect
environment:
- "AIRCAST_VAR=-x /config/airconnect/aircast.xml"
- "AIRUPNP_VAR=-x /config/airconnect/airupnp.xml"
Hey! Thanks for the container.
I'm having trouble passing any options to airconnect using the AIRCAST_VAR variable.
Here is what my docker-compose config looks like. originally I was trying to us
-x
but switched to-d
to try to debug.Anytime I run
docker-compose up airconnect
(to debug) and haveAIRCAST_VAR
set to any of the flags I get the following output.Without using
AIRCAT_VAR
this is what I seeEverything runs fine if I
docker exec
into the container and run it normally.