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 #2

Closed
wants to merge 1 commit into from
Closed

Add Docker support #2

wants to merge 1 commit into from

Conversation

pataquets
Copy link
Contributor

Add Dockerfile to enable image building. Useful for development and tests under Docker workflow.
Using the official Golang image, onbuild tag. More info at https://hub.docker.com/_/golang/
No Golang install needed on systems with Docker, both for running on production or for developing/testing.

Build:

$ docker build -t elastic-go .

Run:

$ docker run --rm -it elastic-go [options...]

FYI, there's a still quicker to test, already built image on my Docker Hub. Test it by running:

$ docker run --rm -it pataquets/elastic-go [options...]

Using --rm causes the container to be deleted after stop.

@pataquets
Copy link
Contributor Author

@rolinh ping?

@rolinh
Copy link
Owner

rolinh commented Aug 8, 2018

Hi @pataquets,

Thanks for your contribution and sorry that it slip through the cracks.
Isn't golang:onbuild deprecated?

@SvenDowideit
Copy link

and as another example where its useful to have a docker image - our elasticsearch is in a separate docker network, and not accessible directly, so we use things like:

docker run --rm -it --net elasticsearch_esnetwork pataquets/elastic-go --baseurl http://elasticsearch:9200 index list

mmm, actually, in this case, I'd also suggest using a multi-stage build so that the resulting image is tiny - see https://github.com/SvenDowideit/elktail/blob/master/Dockerfile for an example @pataquets :)

@rolinh
Copy link
Owner

rolinh commented Mar 20, 2019

@pataquets @SvenDowideit I've added a Dockerfile in commit 0550e45. It's using a multi-stage build to optimize the image size.

@rolinh rolinh closed this Mar 20, 2019
@SvenDowideit
Copy link

noice!

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.

3 participants