-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Releasing docker image for arm64 (#1383)
- Loading branch information
Showing
4 changed files
with
53 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
FROM golang:1.15 | ||
# stage 1 building the code | ||
FROM golang:1.15 as builder | ||
|
||
COPY / /golangci | ||
WORKDIR /golangci | ||
RUN go build -o golangci-lint ./cmd/golangci-lint/main.go | ||
|
||
# stage 2 | ||
FROM golang:1.15 | ||
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume | ||
COPY golangci-lint /usr/bin/ | ||
COPY --from=builder /golangci/golangci-lint /usr/bin/ | ||
CMD ["golangci-lint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
FROM golang:1.15-alpine | ||
# stage 1 building the code | ||
FROM golang:1.15-alpine as builder | ||
|
||
COPY / /golangci | ||
WORKDIR /golangci | ||
RUN CGO_ENABLED=0 go build -o golangci-lint ./cmd/golangci-lint/main.go | ||
|
||
# stage 2 | ||
FROM golang:1.15-alpine | ||
# gcc is required to support cgo; | ||
# git and mercurial are needed most times for go get`, etc. | ||
# See https://github.com/docker-library/golang/issues/80 | ||
RUN apk --no-cache add gcc musl-dev git mercurial | ||
|
||
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume | ||
COPY golangci-lint /usr/bin/ | ||
COPY --from=builder /golangci/golangci-lint /usr/bin/ | ||
CMD ["golangci-lint"] |