getminera / minera

Minera is a web interface to monitor and manage mining devices
http://getminera.com
Other
372 stars 156 forks source link

First shot at Dockerizing + getMacLinux() function fixes #155

Closed trinitronx closed 7 years ago

trinitronx commented 8 years ago

Changes:

If you appreciate the work, I do accept tips: Gratipay

michelem09 commented 8 years ago

Thanks man! Really appreciate, I hope to test it quickly to release with the next Minera version.

trinitronx commented 8 years ago

Probably easiest way to test:

EDIT: Instead of doing the build yourself, you may opt to just run the docker/run.sh script once you have a Docker Host up and running. I've already built an image for testing and pushed to Docker Hub @ trinitronx/minera:latest. Note that I've separated out the Redis dependency so it can be run in it's own container, and am using the official redis image.

trinitronx commented 8 years ago

Note: I think I hardcoded my Docker Hub repo name in the docker/build.sh and docker/run.sh scripts... but that can be changed... I must've missed that last night trying to go fast. Anyway.. the image is pushed already so you can pull if you don't wish to build yourself. It was built off of the tip of this PR branch: trinitronx/minera:v0.7.1-pre-35150a9 == trinitronx/minera:latest.

alberttwong commented 7 years ago

It seems like it got merged but I don't see a dockerfile in the current master branch.

alberttwong commented 7 years ago

I tried the image in docker hub. Didn't work for me.

ovpn-117-51:sandbox alwong$ docker run -t -i --privileged trinitronx/minera
mount: /sys/fs/cgroup is busy
Failed to insert module 'autofs4': No such file or directory
systemd 230 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN)
Detected virtualization docker.
Detected architecture x86-64.

Welcome to Debian GNU/Linux stretch/sid!

Set hostname to <b2308a939c50>.
Cannot determine cgroup we are running in: No medium found
Failed to allocate manager object: No medium found
[!!!!!!] Failed to allocate manager object, freezing.
Freezing execution.
michelem09 commented 7 years ago

Don't know it was made by @trinitronx I just merged it in the master branch.

trinitronx commented 7 years ago

@alberttwong : Sorry about the lack of documentation, I realized that this particular container needs a bit of extra options in order to start.

Because it uses SystemD inside the container, you need to run it with a couple options:

I put a comment on the appropriate docker issue #7459 detailing my testing & findings on how to get SystemD working inside a docker container.

So to start this, you need to do something like this:

docker run -t -i --privileged -v /sys/fs/cgroup:/sys/fs/cgroup -v /var/run/dbus:/var/run/dbus -e 'container=docker' trinitronx/minera

Note that you may also opt to avoid the -ti options for interactive mode, and just pass in -d instead to run it in daemon mode.

You may also wish to check out the run script I added to this repo under minera/docker/run.sh.