Skip to content

Update dockerfile #11

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

Merged
merged 1 commit into from
Sep 26, 2016
Merged

Update dockerfile #11

merged 1 commit into from
Sep 26, 2016

Conversation

ABaldwinHunter
Copy link
Contributor

  • Make compliant with SPEC
  • Update go image

@codeclimate-community/cc-staff

@@ -13,6 +13,6 @@ BUILD_SCRIPT="cd /src && "\
"rm -rf build && mkdir build && "\
"go build -o build/codeclimate-golint ."

docker run -v "$SRC_ROOT:/src" yunspace/alpine-golang /bin/sh -c "$BUILD_SCRIPT"
docker run -v "$SRC_ROOT:/src" golang:latest /bin/sh -c "$BUILD_SCRIPT"
Copy link
Contributor

Choose a reason for hiding this comment

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

I noted this on the other PR after it merged, but should we also use golang:alpine here? It should make CI a bit faster (one image to pull instead of two), and also just seems preferable in terms of being consistent about which image we're using.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that golang:alpine doesn't have git

Build script errors like so:

...
github.com/codeclimate/cc-engine-go (download)
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/codeclimate/cc-engine-go/engine: exec: "git": executable file not found in $PATH
github.com/golang/lint (download)
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/golang/lint: exec: "git": executable file not found in $PATH

Copy link

@dblandin dblandin Sep 26, 2016

Choose a reason for hiding this comment

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

You could install git separately:

docker run -v "$SRC_ROOT:/src" golang:alpine /bin/sh -c "apk --update add git && $BUILD_SCRIPT"

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I think installing a new package every time we build would probably cancel out any time savings from pulling a smaller image, so maybe this should stay as-is.

@@ -1,6 +1,12 @@
FROM alpine:3.2
FROM golang:alpine

Copy link
Contributor

@wfleming wfleming Sep 26, 2016

Choose a reason for hiding this comment

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

I think we can keep the base image plain alpine here: go lint doesn't need the go base toolchain installed (gofmt & go vet do), so I think this is just making the image bigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it matter that alpine:3.2 has go ~1.4 installed?

go lint doesn't need the go base toolchain installed (go lint & go vet do)

There was an issue with govet recently where the go version in image seemed to result in unexpected engine behavior. Are you suggesting that the go version doesn't matter here in the same way since golint is its own package?

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you suggesting that the go version doesn't matter here in the same way since golint is its own package?

Precisely. Go vet & Gofmt interact with base parts of the go toolchain, so having that toolchain installed is necessary, and which version is installed matters.

Go lint doesn't use the toolchain at all except to get compiled (which is what bin/build does). The currently shipped image doesn't even have go installed, and I don't think we need to change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool sounds good. Updated

@ABaldwinHunter
Copy link
Contributor Author

@wfleming Ready for another look!

@wfleming
Copy link
Contributor

LGTM

- Make compliant with SPEC
- Update go image
@ABaldwinHunter ABaldwinHunter merged commit 2843e3b into master Sep 26, 2016
@ABaldwinHunter ABaldwinHunter deleted the abh-update-go-image branch September 26, 2016 21:57
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