scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 90 forks source link

Docker locks up in my_init #36

Closed loleg closed 8 years ago

loleg commented 9 years ago

When running the current Docker build, the VM endlessly cycles in /sbin/my_init, with log messages like:

./run: line 33: setuid: command not found
./run: line 34: setgid: command not found
./run: line 39: respawn: command not found

It seemed something is amiss with the base image? I tried swapping out realms-base for:

FROM phusion/baseimage:0.9.15
RUN useradd -M deploy

But that had no effect.

scragg0x commented 9 years ago

Fixed here: 6c7095ec5a32df19e85eacf3c82258e241bc2e47 Deploying new docker image to the hub. Apparently 'env' isn't used in runsv.

Let me know if it works for you.

loleg commented 9 years ago

Thanks very much for the quick fix @scragg0x - rebuilt from your source and it is working now. I do still see some of those errors in my docker log:

*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
No SSH host key available. Generating one...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 96
./run: line 3: limit: command not found
./run: line 5: respawn: command not found
./run: line 7: description: command not found
./run: line 8: author: command not found
./run: line 10: chdir: command not found
./run: line 33: setuid: command not found
./run: line 34: setgid: command not found
./run: line 39: respawn: command not found
scragg0x commented 9 years ago

ok, I will fix that in the next deploy. I guess assumed runsv was just like upstart... when it's just a bash script after all.

CristianCantoro commented 9 years ago

Just a quick note. After spending some time trying to figure out this problem I have found this bug. It seems that the realms-wiki@DockerHub the latest version availabe is 0.5.1 so I think this has not been fixed yet.

EDIT: but if you build from the Dockerfile with a command like this:

(sudo) docker build -t yourname/realms-wiki .

(Add sudo only if you need it to run the docker command).

I suggest to use your name for naming the image not to conflict with the official realms/realms-wiki on Docker Hub.

With this everything works.

theherk commented 9 years ago

Thank you @CristianCantoro, that did the trick. Just a note you'll need not only the Dockerfile, but also the shell script. You can get these with:

wget https://raw.githubusercontent.com/scragg0x/realms-wiki/master/docker/Dockerfile
wget https://raw.githubusercontent.com/scragg0x/realms-wiki/master/docker/realms-wiki.sh
CristianCantoro commented 9 years ago

@theherk, yes. I was assuming that the instructions were for people that have cloned the repo and could edit directly the Dockerfile (and have all the rest on their system).

eric-schleicher commented 9 years ago

Sorry, I'm a little slow on the uptake... what exactly needs to be changed in the Dockerfile and/or realms-wiki.sh file to get passed the problem that @loleg brought to attention?

i 'wgetted' the files that @theherk put references to as well as cloned the repo locally both with the same result.


user@structr-sandbox:~$ docker run -t -i -p 8000:5000 user/realms-wiki
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
No SSH host key available. Generating one...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
invoke-rc.d: policy-rc.d denied execution of restart.
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 96
./run: line 3: limit: command not found
./run: line 5: respawn: command not found
./run: line 7: description: command not found
./run: line 8: author: command not found
./run: line 10: chdir: command not found
./run: line 33: setuid: command not found
./run: line 34: setgid: command not found
./run: line 39: respawn: command not found

Superficially this looks like the user running the script in the container lacks suffecient priveledges (to fee the commands? (limit, respawn, etc)

Please advise, this looks like a great wiki, excited to give it q real whirl.

scragg0x commented 9 years ago

issue should be fixed in b30c140e86e52da1aee4b1e6432428d933161480. I am attempting to deploy now.

theherk commented 9 years ago

@eric-schleicher, The question is from which source was the image that you are running was built. You are running user/realms-wiki, but was that built from the repository online or from the files that your pulled down?