Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to use newest version of mongo & fixed data volume binds #10

Merged
merged 17 commits into from
Jun 3, 2015
Merged

Conversation

mut3
Copy link
Contributor

@mut3 mut3 commented Jun 2, 2015

bowline was building and relying on the deprecated `dockerfile/mongodb'
https://registry.hub.docker.com/u/deprecateddockerfile/mongodb/

mongo has moved to 'library/mongo' and command syntax has changed somewhat
https://registry.hub.docker.com/_/mongo/

I upgraded the build_it and run_it scripts to use the newer and maintained version of mongo.

Due to an unrelated issue with container permissions I was unable to get the scripts to execute.

On line 30 of build_it.sh:

docker run -d -v $MONGO_DIR:/data/db --name temp_mongo library/mongo

(port binding to 27017 is now done automagically by mongo)

This container would exit as soon as it was started, meaning the link on line 36:

docker run -it --rm --link temp_mongo:mongo -v $EXAMPLE_DATA:/exampledata/ library/mongo \...

would fail, because you cannot link to a dead container.

The temp_mongo container was crashing and burning due to an error:

chown: cannot read directory `/data/db': Permission denied

That chown call comes from line 9 of the docker_entrypoint.sh script that is part of the mongo container.
https://github.com/docker-library/mongo/blob/master/3.0/docker-entrypoint.sh

The solution for this error, which would kill any docker run command with a -v data volume bind to a local directory, is to have the container run in --privileged mode, allowing it to access the host file system.
https://docs.docker.com/reference/run/#runtime-privilege-linux-capabilities-and-lxc-configuration

After adding the --privileged flag to lines that had previously error'd out in build_it.sh and run_it.sh I successfully* ran a locally hosted Bowline on my CentOS 7 box with Docker 1.6.0.

mut3 added 17 commits June 1, 2015 14:29
mongo's repo location seems to have updated, replaced every instance of
dockerfile/mongodb with library/mongo
wide scale replacing of dockerfile/mongodb with library/mongo did not
account for the URL change to point at the new mongo location
This line consistently errored out because it would not find the file
specified and then the nginx.conf file would not get copied over
BUG KILL- thanks to @patrickmslatteryvt for helping me fix the
permission error when mounting local directory to /data/db
must run -v binds to local dirs as --privileged
@dougbtv
Copy link
Owner

dougbtv commented Jun 3, 2015

Awesome work. Looks excellent reviewing on mobile, I'll merge it when I'm back at a legitimate workstation.

Great finds all around, really appreciate it.

dougbtv added a commit that referenced this pull request Jun 3, 2015
Upgraded to use newest version of mongo & fixed data volume binds
@dougbtv dougbtv merged commit 1163e33 into dougbtv:master Jun 3, 2015
@dougbtv
Copy link
Owner

dougbtv commented Jun 3, 2015

@mut3 -- thanks again! Appreciated it. Realized on your profile, you're also in Burlington, VT. Small world, as I am too. You should come drop by LaboratoryB.org and our spot on pine street at some point, I owe you a beer (or tea, if that's how you roll). Thanks Will.

@mut3
Copy link
Contributor Author

mut3 commented Jun 3, 2015

@dougbtv I was planning to sometime soon. I realized that i didnt update the MONGO_CONNECT_STRING in includes/example.config.json to be mongo://mongo/bowline and I just pushed that, you could probably manually do it too.

@mut3 mut3 mentioned this pull request Jun 3, 2015
@dougbtv
Copy link
Owner

dougbtv commented Jun 3, 2015

Thanks @mut3 -- went ahead and manually corrected it, good eye. It's in master now, too.

@mut3
Copy link
Contributor Author

mut3 commented Jun 3, 2015

I noted in #12 issues I believed to be outside the scope of this PR and did not stop the app from running with an attached mongo db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants