Skip to content

Commit

Permalink
Switch to bci image
Browse files Browse the repository at this point in the history
Signed-off-by: futuretea <[email protected]>
  • Loading branch information
futuretea authored and guangbochen committed Mar 7, 2022
1 parent 749abed commit 6506930
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
run:
deadline: 5m
skip-dirs:
- go/pkg/mod
linters:
enable:
- vet
Expand All @@ -13,8 +15,6 @@ linters:
- unused
- unparam
- ineffassign
- scopelint
- maligned
- prealloc
- stylecheck
- goconst
Expand Down
49 changes: 25 additions & 24 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
FROM golang:1.16.5-alpine3.13

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

RUN apk update && apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates

# install goimports
RUN GO111MODULE=on go get golang.org/x/tools/cmd/[email protected]

## install golangci-lint
RUN if [ "${ARCH}" = "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.27.0; \
fi

ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS
ENV DAPPER_SOURCE /go/src/github.com/harvester/terraform-provider-harvester
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}

WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]
FROM registry.suse.com/bci/golang:1.16

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

RUN zypper -n rm container-suseconnect && \
zypper -n install git curl docker gzip tar wget awk zip

# install goimports
RUN GO111MODULE=on go get golang.org/x/tools/cmd/[email protected]

## install golangci-lint
RUN if [ "${ARCH}" = "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.44.0; \
fi

ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS
ENV DAPPER_SOURCE /go/src/github.com/harvester/terraform-provider-harvester
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}

WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]

0 comments on commit 6506930

Please sign in to comment.