matrix-org / matrix-ircd

An IRCd implementation backed by Matrix.
Apache License 2.0
224 stars 41 forks source link

Add dockerfile with binary #61

Closed halkeye closed 4 years ago

halkeye commented 4 years ago

Seems to work so far

Attaching as a comment a nice makefile, but didn't think it was a requirement for the PR.

Makefile:

.DEFAULT_GOAL := build

NAME = matrix-ircd
TAGNAME = halkeye/$(NAME)
VERSION = latest

build: ## Build docker image
        docker build -t $(TAGNAME):$(VERSION) .

push: ## push to docker hub
        docker push $(TAGNAME):$(VERSION)

run:
        docker run -it --name $(NAME) -p 5999:5999 $(TAGNAME):$(VERSION)

.PHONY: help
help:
        @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
jplatte commented 4 years ago

I'm not that familiar with Docker. Why would we want this?

halkeye commented 4 years ago

Ummmm, thats a good question :)

So for me, I'm running all my apps inside of kubernetes, which needs docker for the various apps. I currently have my own image, but I like associating it with the actual repos.

If you agree there is a need, then adding the docker file to the repo itself means you can add it to hub.docker (or your own CI), and have an image (latest master, tagged, etc) automatically built

Then its just super easy to deploy, docker run -p 5999:5999 matrix-org/matrix-ircd and it'll download and run the container with all the requirements

jplatte commented 4 years ago

I'm not opposed to having this here, but I'm also not super convinced that we should have it. Let's wait until @erikjohnston has time to look at this, maybe he has an opinion.

phlmn commented 4 years ago

@jplatte It's been some time now. Do we want to merge this? The Dockerfile looks fine and I'm personally glad to find official docker images for applications.

We should add building and pushing the image to our travis pipeline though.

jplatte commented 4 years ago

@phlmn As I wrote before, I'm not opposed. I still don't really have any experience with Docker, so can't comment beyond that. Feel free to merge now if you want to do the travis stuff separately. I have no idea how much effort that would be.