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

Merged
merged 14 commits into from
Jun 5, 2020
Merged

Add Dockerfile #80

merged 14 commits into from
Jun 5, 2020

Conversation

rbren
Copy link
Contributor

@rbren rbren commented Jun 2, 2020

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jun 2, 2020

CLA assistant check
All committers have signed the CLA.

.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated
RUN go mod download

COPY . .
RUN go build -a -o pluto *.go
Copy link
Member

Choose a reason for hiding this comment

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

There are more flags necessary here to make it build like the normal binary. In particular, you'll want -s and -w, as well as passing the version and commit as build args.

pluto/Makefile

Line 12 in 81c8d32

$(GOBUILD) -o $(BINARY_NAME) -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -s -w" -v

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh nice, didn't see the make file. I'm just running make build-linux now. Do I need to pass in VERSION etc?

Also looks like there's a build-docker already, seems to be working

Copy link
Member

Choose a reason for hiding this comment

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

I think you'll need to add the ARG directive to the dockerfile so that it gets picked up on build to make the build-docker work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh cool, I'd never seen ARG before. Did I do it right?

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #80   +/-   ##
=======================================
  Coverage   78.49%   78.49%           
=======================================
  Files           6        6           
  Lines         372      372           
=======================================
  Hits          292      292           
  Misses         53       53           
  Partials       27       27           

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 81c8d32...21e1019. Read the comment docs.

Copy link
Member

@sudermanjr sudermanjr left a comment

Choose a reason for hiding this comment

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

Looks like you'll need the build-arg:

└─ docker run quay.io/fairwinds/pluto:build_377 /pluto version
Version:local-dev Commit:e020c9b98796232c37daedae0a6879d7775c13ad

Also, you may want to add an entrypoint or a command so that the dockerfile just runs the binary by default.

Edit: Actually, not sure about the build arg. Forgot I wasn't building a tag.

@sudermanjr sudermanjr merged commit 520efde into master Jun 5, 2020
@sudermanjr sudermanjr deleted the rb/dockerfile branch June 5, 2020 15:21
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