attic-labs / noms

The versioned, forkable, syncable database
Apache License 2.0
7.44k stars 266 forks source link

Create a Dockerfile #3789

Closed stevepeak closed 6 years ago

stevepeak commented 6 years ago

Add a Dockerfile and officially support a Docker build to help adaption rate and customer onboarding.

@dustywilson I found your Docker build and would love to know if you had any issues or feedback that could help Noms create an official Dockerized version of the product. Thanks!

stevepeak commented 6 years ago

I've created the organization on Docker Hub https://hub.docker.com/u/noms/ -- will transfer over ownership to the main contributors once I get their emails to invite. 👍

aboodman commented 6 years ago

Maybe add the missing deps you found @stevepeak?

stevepeak commented 6 years ago

Certainly! I'll be submitting a PR soon with a working container and instructions on how to maintain (which I'm happy to do).

emmaly commented 6 years ago

@stevepeak We haven't been using it lately, but when we were using it we had zero problems whatsoever. You're welcome to use the Dockerfile I created verbatim or modified however you want. Mine was super simple and worked fine, but I don't know if there have been any important changes in recent times that would cause you to want to make a change as to how it is done. I know that new features have come out for Docker to support multi-stage builds, so you could, in theory, build it in such a way that you use golang base image to do the build, but then distribute a container that contains literally one single binary (assuming there's no shelling out for anything, need non-embedded CA certs, etc). If I were to re-implement now, that's what I would do.

https://docs.docker.com/engine/userguide/eng-image/multistage-build/ has info on how to go about doing that, and I highly recommend understanding that before proceeding with a new Dockerfile.

kav commented 6 years ago

Looks like the Dockerfile in the repo is pretty good. Any chance someone can publish it to the noms organization in dockerhub so the rest of us can just pull it from there?

kav commented 6 years ago

Might also want to add:

ENV CGO_ENABLED=0
ENV GOOS=linux

to the build container so the runtime container works. Happy to PR if you are still taking PRs

emmaly commented 6 years ago

FYI we're going to delete our repo at scjalliance/noms. Your Dockerfile in this repo is looking very good, so I see no point in keeping the one at scjalliance around. (FYI I was formerly @dustywilson, but changed username.) Thanks for taking this task forward!

aboodman commented 6 years ago

Might also want to add:

Done.

aboodman commented 6 years ago

Any chance someone can publish it to the noms organization in dockerhub so the rest of us can just pull it from there?

Done: https://hub.docker.com/r/noms/noms/.

aboodman commented 6 years ago

I also set it up to autobuild, so it should stay up to date.