Releasing docker image for arm64 (#1383)
This commit is contained in:
parent
3e6b01e716
commit
3368a55627
35
.github/workflows/tag.yml
vendored
35
.github/workflows/tag.yml
vendored
@ -26,3 +26,38 @@ jobs:
|
|||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
|
||||||
|
- name: Prepare
|
||||||
|
id: prepare
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
MAJOR=${TAG%.*}
|
||||||
|
echo ::set-output name=tag_name::${TAG}
|
||||||
|
echo ::set-output name=major_tag::${MAJOR}
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: build and publish main image
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: build/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
golangci/golangci-lint:${{ steps.prepare.outputs.tag_name }}
|
||||||
|
golangci/golangci-lint:${{ steps.prepare.outputs.major_tag }}
|
||||||
|
golangci/golangci-lint:latest
|
||||||
|
- name: build and publish alpine image
|
||||||
|
id: docker_build_alpine
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: build/Dockerfile.alpine
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
golangci/golangci-lint:${{ steps.prepare.outputs.tag_name }}-alpine
|
||||||
|
golangci/golangci-lint:${{ steps.prepare.outputs.major_tag }}-alpine
|
||||||
|
golangci/golangci-lint:latest-alpine
|
||||||
|
@ -63,22 +63,6 @@ changelog:
|
|||||||
- Merge pull request
|
- Merge pull request
|
||||||
- Merge branch
|
- Merge branch
|
||||||
|
|
||||||
dockers:
|
|
||||||
- dockerfile: build/Dockerfile
|
|
||||||
binaries:
|
|
||||||
- golangci-lint
|
|
||||||
image_templates:
|
|
||||||
- "golangci/golangci-lint:latest"
|
|
||||||
- "golangci/golangci-lint:{{ .Tag }}"
|
|
||||||
- "golangci/golangci-lint:v{{ .Major }}.{{ .Minor }}"
|
|
||||||
- dockerfile: build/Dockerfile.alpine
|
|
||||||
binaries:
|
|
||||||
- golangci-lint
|
|
||||||
image_templates:
|
|
||||||
- "golangci/golangci-lint:latest-alpine"
|
|
||||||
- "golangci/golangci-lint:{{ .Tag }}-alpine"
|
|
||||||
- "golangci/golangci-lint:v{{ .Major }}.{{ .Minor }}-alpine"
|
|
||||||
|
|
||||||
brews:
|
brews:
|
||||||
- tap:
|
- tap:
|
||||||
owner: golangci
|
owner: golangci
|
||||||
|
@ -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
|
# 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"]
|
CMD ["golangci-lint"]
|
||||||
|
@ -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;
|
# gcc is required to support cgo;
|
||||||
# git and mercurial are needed most times for go get`, etc.
|
# git and mercurial are needed most times for go get`, etc.
|
||||||
# See https://github.com/docker-library/golang/issues/80
|
# See https://github.com/docker-library/golang/issues/80
|
||||||
RUN apk --no-cache add gcc musl-dev git mercurial
|
RUN apk --no-cache add gcc musl-dev git mercurial
|
||||||
|
|
||||||
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
|
# 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"]
|
CMD ["golangci-lint"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user