使用lint命令构建docker go应用

I've created the following docker container , all works except on thing which is the make lint

In the project root I've Makefile with the current entry

lint:
    gometalinter --config=gometalinter.json ./...

when I use it locally in my machine (macbook) and if for example file is not formatted go fmt I get error when executing above code.

The problem is that when I create the docker image via docker build command

I got different linting issues which is not related to my project. in the gometalinter.json I've the following entry to bypass the vendor directory

{
  "vendor": true
}

This is the docker content

FROM golang:1.11.1-alpine3.7 

RUN apk add --update --no-cache git make curl bash

ADD https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep

WORKDIR /go/src/my-proj

COPY . ./

COPY Gopkg.toml Gopkg.lock ./

RUN dep ensure 
# From the error it seems that this is related to cgo but even adding the next line doesnt helps, same error occurred 
RUN CGO_ENABLED=0
# this command download gometalinter which is running OK
RUN make download 

RUN make lint

when I run the lint this is what I got which is not related to my project

../../../usr/local/go/src/net/lookup_unix.go:80:24:warning: error return value not checked (undeclared name: cgoLookupHost) (errcheck)
../../../usr/local/go/src/net/lookup_unix.go:95:24:warning: error return value not checked (undeclared name: cgoLookupIP) (errcheck)
../../../usr/local/go/src/net/lookup_unix.go:107:23:warning: error return value not checked (undeclared name: cgoLookupPort) (errcheck)
../../../usr/local/go/src/net/lookup_unix.go:123:24:warning: error return value not checked (undeclared name: cgoLookupCNAME) (errcheck)
../../../usr/local/go/src/net/lookup_unix.go:323:23:warning: error return value not checked (undeclared name: cgoLookupPTR) (errcheck)

You are not correctly setting the environment variable in your Dockerfile.

RUN CGO_ENABLED=0

should be

ENV CGO_ENABLED=0