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 Dockerfile #29

Merged
merged 4 commits into from
Mar 29, 2018
Merged

Add Dockerfile #29

merged 4 commits into from
Mar 29, 2018

Conversation

kochman
Copy link
Owner

@kochman kochman commented Mar 29, 2018

Just use the default Go base Docker image. We could be a lot smarter about a multi-step builder so we don't have all of the source files laying around in the resulting Docker image, but this is fine for now.

The .dockerignore ignores everything and then includes only what we need to actually compile and run the binary.

@kochman
Copy link
Owner Author

kochman commented Mar 29, 2018

@JCBird1012 @nelsonw2014 Not sure which one of you would rather review this, so go ahead if you want.

@codecov
Copy link

codecov bot commented Mar 29, 2018

Codecov Report

Merging #29 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   54.61%   54.61%           
=======================================
  Files           4        4           
  Lines         390      390           
=======================================
  Hits          213      213           
  Misses        151      151           
  Partials       26       26

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c147c8f...1e12d52. Read the comment docs.

@warrn
Copy link
Collaborator

warrn commented Mar 29, 2018

I got it

Copy link
Collaborator

@warrn warrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just this change and we can push

Dockerfile Outdated
COPY . /go/src/github.com/kochman/hotshots
RUN go install github.com/kochman/hotshots

ENV HOTSHOTS_DIR /var/hotshots
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is predefined in code, we don't need to set the env var

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also you need to make the directory /var/hotshots and make sure permissions work for hotshots, otherwise it won't start.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking it would be better to be explicit about it, but I'll remove it. Also, /var/hotshots should be mounted into the container when it is run (I'll document this), so it will have open enough permissions by default.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, remove that line and add some form of documentation and I'll merge

@warrn
Copy link
Collaborator

warrn commented Mar 29, 2018

We should at some point test the dockerfile actually starts in our travis build. For another time

@kochman
Copy link
Owner Author

kochman commented Mar 29, 2018

Yeah, good idea

@warrn
Copy link
Collaborator

warrn commented Mar 29, 2018

On a separate note, is there a way to make it so travis build is only required if *.go files are changed?

@kochman
Copy link
Owner Author

kochman commented Mar 29, 2018

Yeah, we could definitely do something with having the build ask git if there were any changes in *.go files in the branch.

@warrn
Copy link
Collaborator

warrn commented Mar 29, 2018

Also we should definitely stop it from building twice lol

@warrn warrn merged commit 9bbdb13 into master Mar 29, 2018
@warrn warrn deleted the docker branch March 29, 2018 19:22
@kochman
Copy link
Owner Author

kochman commented Mar 29, 2018

What do you mean by twice?

@warrn
Copy link
Collaborator

warrn commented Mar 29, 2018

there's two checks, one for a pr, the other for anything that is pushed. We should probably kill the pr one.

@kochman
Copy link
Owner Author

kochman commented Mar 29, 2018

I think they're both important. PR tests the resulting merge commit into master; push just checks the branch.

@warrn
Copy link
Collaborator

warrn commented Mar 29, 2018

That's fair, but usually merging into branch should be required before push to master

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