diff --git a/.golangci.yml b/.golangci.yml index 25c2d11c..78c15b81 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,7 @@ run: deadline: 5m + skip-dirs: + - go/pkg/mod linters: enable: - vet @@ -13,8 +15,6 @@ linters: - unused - unparam - ineffassign - - scopelint - - maligned - prealloc - stylecheck - goconst diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 69937226..430e130d 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -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/goimports@v0.1.2 - -## 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/goimports@v0.1.9 + +## 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"]