firecat53 / dockerfiles

Dockerfiles: Gollum, Jackett, Miniflux, Nginx/PHP-FPM, Plex, Privatebin, Qbittorrent, Radarr, Sabnzbd, Samba, SSH Socks Proxy server, Sonarr, Syncthing, Transmission, Unifi Controller.
MIT License
623 stars 93 forks source link

How is this working? #1

Closed mattfox27 closed 10 years ago

mattfox27 commented 10 years ago

Im trying to set this up because i want to isolate my torrents to VPN but allow my other services to run on regular lan...Just came accross this and it looks like exactly what i need. I have never used docker before, is there any pointers you can give?

Thanks

firecat53 commented 10 years ago

Well, you need to get Docker installed first and read up on the basic concepts. There's a basic tutorial on their website (docker.io). You also need a privateinternetaccess.com account. Then it's just a matter of carefully working your way through the README, making sure you don't skip anything (especially editing all the configuration values).

Disclaimer: Docker isn't an easy concept at first, and this is far from a plug and play solution! If you have specific questions, I'll do my best :) #docker on Freenode is also fairly active during the day as well, and they are a lot smarter than me!

mattfox27 commented 10 years ago

Ya, docker is a little difficult to get my head around, i would say my linux skills are medium...Im trying to virtualize my torrent clients on ubuntu 13.10 because i have everything running on one machine a dual core box but it also runs XBMC and the whole thing is VPN'd with PIA but its killing my streaming capabilities. I was thinking of just setting up a headless virtualbox VM with 512bm ram just to run transmission/deluge/openvpn and NFS do you think docker would be better? I have 4gb ram core2duo.

I setup docker but do i just edit the private_files and run the docker file and thats pretty much it? How do i access transmission via docker? Do i just use the Docker IP in ifconfig?

Do i still need to use pipework? If so is that just a script i call?

Thanks so much for the help, really appreciate it.

firecat53 commented 10 years ago

Docker will always be lighter than running a full virtual machine. That's just the nature of containers!

After you edit the private files, you have to build the container (just like the README). If you don't want to use the data-only volume setup, when you run the container you would just use -v /mnt/media:/data instead of --volumes-from media_data

Once the container is running, you would access transmission via the web interface on the IP address that you set with pipework (:9091/transsmission/web). I think the newest versions of Docker have a flag to attach the container to an existing network bridge on the host without using pipework, but I haven't tried that yet. In a 'normal' container that doesn't use pipework, you would expose the port you wanted to access using the -p flag for docker run.

On your host, you just need to download pipework and either symlink it somewhere in your $PATH or just run it from that directory. It's just a single bash script. Nothing will happen in the container until you run pipework (because of the pipework --wait in start.sh).

Scott

mattfox27 commented 10 years ago

OK, thanks for the info, let me play around with it and see where i get...

mattfox27 commented 10 years ago

OK i think i kinfda got it going...After running docker run -d --privileged --networking=False --volumes-from transmission_config --volumes-from media_data --name transmission transmission

It says

root@ubuntu:~# docker run -d --privileged --networking=False --volumes-from   transmission_config --volumes-from media_data --name transmission transmission
fedfc471e05a3f59ed1b59fd8766b734f4d2b1c9651c3cf9e4961d52a0b8d6d9
2014/06/08 20:25:13 Error: Cannot start container     fedfc471e05a3f59ed1b59fd8766b734f4d2b1c9651c3cf9e4961d52a0b8d6d9: Container     fedfc471e05a3f59ed1b59fd8766b734f4d2b1c9651c3cf9e4961d52a0b8d6d9 not found. Impossible     to mount its volumes

What does this mean? Does if have to do with --volumes-from media_data? Do i have to mount that separately?

Also how would i stop then restart this? I was using these commands are these right? docker stop $(docker ps -a -q) docker rm $(docker ps -a -q)

firecat53 commented 10 years ago

If you are using a data-only volume for your downloads, then you need to make sure the media_data container exists (you can see it with docker ps -a.) Also make sure the transmission_config data-only container exists. If you are just bind-mounting a directory on your host (like /mnt/media) then use the -v flag instead of --volumes-from.

Also, when you start a container with --name xxxx, if you stop it then want to re-run a new container, you have to delete the old container first. You might want to leave off the --name while you are figuring this out, then periodically go back and remove the old containers with docker rm <container id from docker ps -a>.

I'm going to be offline now until tomorrow. It might be easier to chat on IRC :)

mattfox27 commented 10 years ago

OK sounds good, i will read up on docker and play around with it, I REALLY appreciate your help!!

Thanks so much

Maybe we can chat on IRC tomorrow...

Matt

mattfox27 commented 10 years ago

This is the output of docker ps -a>

CONTAINER ID        IMAGE                       COMMAND             CREATED                                 STATUS              PORTS               NAMES
fedfc471e05a        transmission:latest         /start.sh           21 hours ago                          Exit 0                                   transmission
2b144d6a713d        busybox:buildroot-2014.02   /bin/true           21 hours ago                          Exit 0                                  transmission_config
matt@ubuntu:~$
firecat53 commented 10 years ago

I'm available on #docker for awhile here. I forgot to tell you that a good way to troubleshoot a container is to run it with /bin/bash as the command and then manually run the 'start.sh' or whatever else the CMD from the Dockerfile is and see what you get for output. For example:

docker run --rm -it -v /mnt/media:/mnt/media --volumes-from transmission_config transmission /bin/bash

That's why I normally use CMD instead of ENTRYPOINT in my Dockerfiles...it's easier to append the /bin/bash to the run command for troubleshooting.

mattfox27 commented 10 years ago

Im just staring by setting up a Vboxheadless VM, since i need very little resources just to run vpn and transmission and im running on full PC, not sure if it will be a huge resource hog...Im going to try this first and see what kinda resources it pulls. With docker to you have to rebuild it everytime you stop/start it? For instance can this transmission/PIA/port forward docker start automatically on boot?

I really appreciate the help...thanks so much...I will be back

Thanks, Matt

firecat53 commented 10 years ago

If you are just running openvpn/transmission on a single box, then you don't necessarily need Docker. No, you don't have to rebuild the image each time. That's why starting a container is so fast! Yes you can start a Docker container on boot using whatever startup script method your distribution uses (upstart, systemd, rc.local). You can look at the transmission.service file for a systemd example.

firecat53 commented 10 years ago

Did you get it working?

mattfox27 commented 10 years ago

No, i just made a small VM with 256mb memory running Vboxheadless with deluge/transmission and openvpn...

I still would love to try docker again...Is setup a VM just to play with docker

firecat53 commented 10 years ago

Sorry it didn't work out for you! Thanks for trying.