Skip to content

Commit 4c808f9

Browse files
committed
Releasing docker image for arm64: Incorporate review comment
Signed-off-by: odidev <[email protected]>
1 parent ccd68f2 commit 4c808f9

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

.github/workflows/tag.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
go-version: 1.15
1818
- name: Unshallow
1919
run: git fetch --prune --unshallow
20+
- name: Login do docker.io
21+
run: docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
22+
- name: Create release
23+
uses: goreleaser/goreleaser-action@v2
24+
with:
25+
version: latest
26+
args: release --rm-dist
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
2029
- name: Prepare
2130
id: prepare
2231
run: |
@@ -28,15 +37,6 @@ jobs:
2837
uses: docker/setup-qemu-action@v1
2938
- name: Set up Docker Buildx
3039
uses: docker/setup-buildx-action@v1
31-
- name: Login do docker.io
32-
run: docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }}
33-
- name: Create release
34-
uses: goreleaser/goreleaser-action@v2
35-
with:
36-
version: latest
37-
args: release --rm-dist
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
4040
- name: build and publish main image
4141
id: docker_build
4242
uses: docker/build-push-action@v2

build/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# stage 1 building the code
22
FROM golang:1.15 as builder
33

4-
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
5-
RUN git clone https://github.com/golangci/golangci-lint
6-
WORKDIR golangci-lint
7-
RUN go build -o /usr/bin/golangci-lint ./cmd/golangci-lint/main.go
4+
COPY / /golangci
5+
WORKDIR /golangci
6+
RUN go build -o golangci-lint ./cmd/golangci-lint/main.go
87

98
# stage 2
109
FROM golang:1.15
11-
COPY --from=builder /usr/bin/golangci-lint /usr/bin/
10+
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
11+
COPY --from=builder /golangci/golangci-lint /usr/bin/
1212
CMD ["golangci-lint"]

build/Dockerfile.alpine

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
# stage 1 building the code
22
FROM golang:1.15-alpine as builder
33

4+
COPY / /golangci
5+
WORKDIR /golangci
6+
RUN CGO_ENABLED=0 go build -o golangci-lint ./cmd/golangci-lint/main.go
7+
8+
# stage 2
9+
FROM golang:1.15-alpine
410
# gcc is required to support cgo;
511
# git and mercurial are needed most times for go get`, etc.
612
# See https://github.com/docker-library/golang/issues/80
713
RUN apk --no-cache add gcc musl-dev git mercurial
8-
914
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
10-
RUN git clone https://github.com/golangci/golangci-lint
11-
WORKDIR golangci-lint
12-
RUN CGO_ENABLED=0 go build -o /usr/bin/golangci-lint ./cmd/golangci-lint/main.go
13-
14-
# stage 2
15-
FROM golang:1.15-alpine
16-
RUN apk --no-cache add gcc musl-dev git mercurial
17-
COPY --from=builder /usr/bin/golangci-lint /usr/bin/
15+
COPY --from=builder /golangci/golangci-lint /usr/bin/
1816
CMD ["golangci-lint"]

0 commit comments

Comments
 (0)