Skip to content

Commit 20219a5

Browse files
pointlessonemaxjacobson
authored andcommitted
Update Dockerfile
* Updated base image to Alpine 3.4. * `codeclimate-golint` binary is built inside the container. You don't need go on your machine any more to build the image. * Updated README to reflect the change. Also gocx is sort of deprecated since go is good at crosscompiling now. Moreover, it's not needed any more because source is compiled to image-native binary.
1 parent 2843e3b commit 20219a5

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
FROM alpine:3.2
1+
FROM alpine:3.4
22

33
MAINTAINER Code Climate <hello@codeclimate.com>
44

5-
WORKDIR /code
5+
WORKDIR /usr/src/app
6+
COPY codeclimate-golint.go /usr/src/app
67

7-
COPY build/codeclimate-golint /usr/src/app/
8+
RUN apk --update add go git && \
9+
export GOPATH=/tmp/go GOBIN=/usr/local/bin && \
10+
go get -d . && \
11+
go install codeclimate-golint.go && \
12+
apk del go git && \
13+
rm -rf "$GOPATH" rm /var/cache/apk/*
814

15+
WORKDIR /code
916
VOLUME /code
1017

1118
RUN adduser -u 9000 -D app
1219
USER app
1320

14-
CMD ["/usr/src/app/codeclimate-golint"]
21+
CMD ["/usr/local/bin/codeclimate-golint"]

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ engines:
2727
2828
### Building
2929
30-
In order to build the docker image, you first need to compile a binary for the container. To do that, first [install goxc]() and then run
31-
3230
```console
33-
goxc -bc="linux" -tasks-=go-install,go-vet,go-test,package,archive -d=. -arch=amd64 && \
34-
mv snapshot/linux_amd64/codeclimate-golint bin/codeclimate-golint && \
35-
rm -rf snapshot && \
3631
docker build -t codeclimate/codeclimate-golint .
3732
```
3833

0 commit comments

Comments
 (0)