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 Docker support #573

Merged
merged 3 commits into from May 13, 2016
Merged

Add Docker support #573

merged 3 commits into from May 13, 2016

Conversation

pataquets
Copy link
Contributor

Add Dockerfile to enable image building.
By now, I use the official Node image, 'onbuild' tag. More info at https://hub.docker.com/_/node/

Later, I just simply copy the exampleConfig.js into config.js and replace the 'graphite.example.com' hostname by 'graphite' to enable Docker native networking, be it via linking or via aliasing external hosts/containers as 'graphite' and always connect to the 'graphite' host.

Build:

$ docker build -t statsd .

Run (assuming a previously running Graphite Docker conatiner named graphite):

$ docker run -d -it --name statsd --link graphite -p 8125:8125/udp -p 8126:8126 statsd

More optional improvements to come:

  • Creating a dockerConfig.js file which reads all config parametes from environment vars (as I've done previously for movableink/doorman)
  • Create an 'official' automated build at Docker Hub for the image: https://docs.docker.com/docker-hub/builds/

@referup-tarantegui
Copy link

That config is worked for me. +1 for a approve the pull request.

@pataquets
Copy link
Contributor Author

Bump.
Would love to have this reviewed, in case there is more to do to have an initial version.

@gillesdemey
Copy link

Seems trivial to also include a docker-compose.yml file that links graphite.

@pataquets
Copy link
Contributor Author

pataquets commented Apr 29, 2016

Added docker-compose manifest. Uses dockerana/* Docker Hub's official images for graphite-web and carbon and builds the statsd image from current dir.
Perhaps our statsd image should be configured to send metrics to 'carbon' host instead of 'graphite' host to avoid confusion with 'graphite-web' service. Although the stack is called graphite, would be better IMO to make it more clear. Notice that the 'statsd' service has a link to the 'carbon' service but aliased to 'graphite'. Confusing.
EDIT: And/or perhaps removing graphite-web service completely?

@coykitten
Copy link
Contributor

lgtm!

What's the benefit of having these files in the root of the project? Does DockerHub search for these files this way? (Total docker n00b questions im sure)

@coykitten coykitten self-assigned this May 2, 2016
@pataquets
Copy link
Contributor Author

pataquets commented May 4, 2016

Checked it, and the Node image tag we are using here (:onbuild) assumes the source code to be present in the same dir than the Dockerfile.

Also, IIRC Docker can't add files outside the Dockerfile parent dir for security reasons.

I've used the :onbuild, latest Node version as parent image (check https://hub.docker.com/_/node/). Any specific version to stick to?

@coykitten
Copy link
Contributor

@pataquets I would probably pin to node 5.x

While the tests are passing against node-stable, which travis says is 6.0.0, they are also outputting some deprecation errors to stderr which should get a closer look at before using the latest Node image

@pataquets
Copy link
Contributor Author

Sounds safer. I've modified the Dockerfile to pin the Node version to the latest 5.x available.

@pataquets
Copy link
Contributor Author

Bump.

@coykitten coykitten merged commit dbf902c into statsd:master May 13, 2016
@coykitten
Copy link
Contributor

Thanks for the patch! Just FYI I've released the latest on npm as 0.8.0 so you could base your docker build on that if you'd like

@pataquets
Copy link
Contributor Author

How about creating an 'official' automated build at Docker Hub for the image?
https://docs.docker.com/docker-hub/builds/
Just register 'etsy' (optionally making it an organization) and follow the easy steps from the link (requires repo ownership rights). I can help, if needed.

@pataquets
Copy link
Contributor Author

pataquets commented May 19, 2016

Bump.
An organization-user automated build would be enough and it's quick to set up, with adequate permissions on Github's repo following the above link (also the original post's 2nd followup bullet point).
A more involved option would be a Docker Hub official image: https://docs.docker.com/docker-hub/official_repos/

@pataquets
Copy link
Contributor Author

How about the above proposed 'official' Docker Hub image? Looks like 'etsy' user/org is already registered (hopefully by you): https://hub.docker.com/u/etsy/

@pataquets
Copy link
Contributor Author

Bump.

@pataquets
Copy link
Contributor Author

@pathzzrd : ping

@pataquets
Copy link
Contributor Author

Any feedback on creating an 'official' automated build from source on Docker Hub?

@Tyrael
Copy link

Tyrael commented Jun 1, 2018

@pathzzrd : any update on this?

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.

None yet

5 participants