chris102994/docker-toonamiaftermath

What is /path/to/appdata/config?

CHJ85 opened this issue · 27 comments

CHJ85 commented

Hi there. What is the folder I'm suppose to put in here?
Is it the app folder inside? And there's no config folder there.
I'm a bit confused.

</path/to/appdata/config> is the directory on your local machine that you want mapped to /config inside the container. i.e. where persistent data is stored.

CHJ85 commented

Right. But what's with the :/config afterwards?

CHJ85 commented

I removed the :/config part, but now I'm getting
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=docker-toonamiaftermath: dial unix /var/run/docker.sock: connect: permission denied.

/config is the config directory inside the container that you want to map to if you want persistent storage and faster refreshes (see the readme table).

The error you posted above isn't related to this but related to docker on your Unix host. Looks to me like you haven't performed docker post install steps for linux from their official site. The (unrecommended) workaround is to run your command under sudo with root privileges.

Official and further documentation on volume mappings so that you can understand them better can also be found on their official site here.
Exec summary of docker -v /home/<user>/config:/config ... means that anything written inside the container at /config will be persistent across reboots and updates at /home/<user>/config on your Unix host. Likewise anything you put into /home/<user>/config will be seen inside your container at /config

CHJ85 commented

Thanks. I haven't used docker before. It's honestly the most annoying thing ever. Seems like everyone is doing docker now. I don't get it.
Do you think you could post non-docker instructions on how to set this up please?

It can be frustrating but if you get used to it you'll see the benefits. Unfortunately I didn't design the application for non-docker use so I don't have instructions for other ways at the moment.

CHJ85 commented

Okay so I ran it with sudo, and I got this error:

docker: Error response from daemon: failed to create shim: OCI runtime create failed: invalid mount {Destination:unless-stopped Type:bind Source:/var/lib/docker/volumes/fca8ffebf94359f1268ed2e65c9efc96988e6cdba7c0c42a5356a3d8ae3bc691/_data Options:[rbind]}: mount destination unless-stopped not absolute: unknown.
ERRO[0012] error waiting for container: context canceled 

What does this mean?

I cant help you if you don't post your docker run command.

CHJ85 commented

Oh, I'm so sorry.

sudo docker run \                               20s
        --name=docker-toonamiaftermath \
        -p 8000:8000 \
        -v </home/chris/Docker/toonamiaftermath/> \
        --restart unless-stopped \
        christopher102994/docker-toonamiaftermath:ubuntu-18-latest

so </home/chris/Docker/toonamiaftermath/> isn't a valid unix path. You're supposed to remove < and > from the example. Those were there meaning <place your path here>. Also, you're still not mapping anything to it. If /home/chris/Docker/toonamiaftermath/ is the local path you want to map to then it should be -v /home/chris/Docker/toonamiaftermath:/config

CHJ85 commented

Thanks. But now it says docker: Error response from daemon: Conflict. The container name "/docker-toonamiaftermath" is already in use by container "86dc2d8b44ac3fcfe9efab40544100cb9dfd65627f6655935f5129c7e5ff447c". You have to remove (or rename) that container to be able to reuse that name.
As you can tell, I've never used docker before. So please excuse my noobism.

CHJ85 commented

I tried sudo docker stop 86dc2d8b44ac3fcfe9efab40544100cb9dfd65627f6655935f5129c7e5ff447c
but that didn't work.
Then I tried sudo docker stop /docker-toonamiaftermath
which didn't work either.
I mean it stopped the container I guess. But didn't remove it.

You have a running container with that name already.
You can view the running containers with docker ps -a
You can then remove the container with docker rm -f <hash|name>

so in your case you can do: docker rm -f 86d.

Refr: docker rm

CHJ85 commented

Thank you.
So now I ran the command again, I get:

[cont-init.d] 10-display-container-info: exited 0.
[cont-init.d] 40-fix-toonami-attrs: executing... 
[cont-init.d] 40-fix-toonami-attrs: exited 0.
[cont-init.d] 50-first-run: executing...

And now it seems to be stuck. Doesn't seem to be doing anything.

That means it's working it's doing the first run which will take a while. That docker command specifically will keep your terminal session and never let you leave. Perhaps try ctrl+x (exit the container) and ensure it's removed from docker ps -a and next time you run the docker command use the -d flag. This means detach to the background.

Refr: docker run

CHJ85 commented

Thank you. But will this docker always be running in the background until I stop it, even after I reboot the computer?

For that you need --restart unless-stopped in your docker command. Which it already is according to above. So yes.

CHJ85 commented

Thanks. So I typed in the command again with -d at the end, but it's still stuck − forcing me to keep the terminal open. Then I tried adding -d after docker before --run, which didn't work either. What am I doing wrong here?

Not sure what --run pertains to. That's not a docker run option. You need to add it after run so that your command is :

sudo docker run \
       -d \
        --name=docker-toonamiaftermath \
        -p 8000:8000 \
        -v </home/chris/Docker/toonamiaftermath/> \
        --restart unless-stopped \
        christopher102994/docker-toonamiaftermath:ubuntu-18-latest

I don't have time to teach a class on this any further. Hope this helps.

CHJ85 commented

Ah of course. Thank you. And I meant run, not --run.
Okay so it seems to be running now. Although I can't find the .m3u and epg xml files. Where are they be located at?

CHJ85 commented

I already did tell it to put it in the config folder.
So in your script, how do you go about converting the epg json file to xml?
I think I'm just gonna have to do this the old fashion way and set up a cron job for downloading and converting that epg file.
This docker stuff is too much work.

So this gives flexibility for you to point your plex/emby at the URL without having to do the file share pretty simple. If you want that then remove and re-add the container with

sudo docker run \
       -d \
        --name=docker-toonamiaftermath \
        -p 8000:8000 \
        -v /home/chris/Docker/toonamiaftermath:/config \
        -v /home/chris/Docker/toonamiaftermath/data:/data \
        --restart unless-stopped \
        christopher102994/docker-toonamiaftermath:ubuntu-18-latest

then on your local machine you can look in /home/chris/Docker/toonamiaftermath/data for the m3u and xmltv file. Not sure what json file you're talking about. I don't have a single json file in this -- I even use XML for properties

The dockerfile contains the steps for installing it into a system using cron. I can not provide further support or guidance. Good luck. I will not be responding to this issue anymore.

CHJ85 commented

Okay thanks for all your help.

CHJ85 commented

Btw the files do not appear in the data folder.
Not sure what is going on.
By json, I was referring to their EPG.
In your channels xml file, you listed the schedule url https://api.toonamiaftermath.com/media?scheduleName=Toonami%20Aftermath%20EST.
This file is in json. Not xml. So in order to get the epg xmltv, I need to find a way to convert this into xml. Right?
That's why I was wondering how you do that in your script, so that I can do it without having to use Docker.
You see? Because this Docker thing is just too much headache.

CHJ85 commented

Okay Nevermind. I think it works now. After a reboot, the files are there.
Thanks again for all your help.
Seriously.