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

Add a Dockerfile to build a Docker image to run HandyRep effortlessly. #3

Closed
wants to merge 1 commit into from

Conversation

jpetazzo
Copy link

Assuming that one has Docker running on their machine, they can run HandyRep
within a container, by running the following commands:

docker build -t handyrep .
docker run -d -P -v /path/to/some/handyrep.config:/handyrep/handyrep.conf handyrep

For the record, -d just means "run this container in the background", and -P means
"expose the TCP ports of this container". You can check on which port the REST API
is listening with docker ps.

Woud you like me to add some explanations in one of the documentation files as well?

@jberkus
Copy link

jberkus commented Jan 15, 2014

Wow, cool! I didn't expect anything quite this fast! You wrote this while at the SFPUG, no?

Questions:

  1. there's some non-pip dependancies: postgresql-client, postgresql-server-dev (to support psycopg), etc. Should the docker file install those as well?
  2. it also wants some users to be created and permissions to be set (sudoers, etc.). Is that something you'd normally do in a Docker file?
  3. I'm going to create an /platforms/ directory for stuff like this, and move the docker file to it. OK with you?

@jpetazzo
Copy link
Author

Yes, I plead guilty — I wrote this during the meet-up :-)

  1. You're right about non-pip dependencies; I will add those (especially postgresql-client, since it looks like libpq-dev already covers the needs of psycopg, unless I missed something obvious!).
  2. It is OK to run as root inside the container, so I don't know if it will be necessary to setup sudo. I will investigate.
  3. Absolutely! Do you want me to update the pull request to move the Dockerfile to e.g. /platforms/docker/Dockerfile?

I will do some testing (I need to author a Docker container with PostgreSQL+SSH), then resubmit a more complete pull request.

Thank you!

@jberkus
Copy link

jberkus commented Jan 15, 2014

J,

  1. Thanks!
  2. yeah, not sure about a reasonable config for that. HandyRep doesn't really do anything unless you have containers running PostgreSQL to do replication as well.
  3. yes, please!

@jberkus
Copy link

jberkus commented Feb 26, 2014

Any updates? Saw you briefly at SCALE but didn't get a chance to talk.

@jpetazzo
Copy link
Author

Yes!

We're "in talks" to allow the Docker build process to work when the Dockerfile is not in the root directory. Because currently, if I put the Dockerfile in platforms/..., then it can't access the source code when building the container.

If it doesn't progress, I'll probably find a workaround (e.g. simple build instructions involving a symlink or something like that).

Yes, I think I spotted you at SCALE as well; unfortunately my schedule was... hectic! And I missed the whole PgSQL track, which makes me feel like the saddest panda ever. But I had to fly in Friday morning, and then prepare and deliver my talk at Puppetcamp. I'll definitely catch up during a future PgSQL meetup in SF!

If you don't like keeping an open pull request without an actionable item, feel free to close this PR, and I'll reopen it later once I have something nicer.

@jberkus
Copy link

jberkus commented Apr 15, 2014

Closing per discussion above.

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