github.com/weaveworks/common@v0.0.0-20230728070032-dd9e68f319d5/tools/build/golang/Dockerfile (about)

     1  FROM golang:1.12.1-stretch
     2  RUN apt-get update && \
     3      apt-get install -y \
     4        curl \
     5        file \
     6        git \
     7        jq \
     8        libprotobuf-dev \
     9        make \
    10        protobuf-compiler \
    11        python-pip \
    12        python-requests \
    13        python-yaml \
    14        shellcheck \
    15        unzip && \
    16      rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    17  RUN pip install attrs pyhcl yapf==0.16.2 flake8==3.3.0
    18  RUN curl -fsSLo shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \
    19  	echo "b1925c2c405458811f0c227266402cf1868b4de529f114722c2e3a5af4ac7bb2  shfmt" | sha256sum -c && \
    20  	chmod +x shfmt && \
    21  	mv shfmt /usr/bin
    22  RUN go clean -i net && \
    23  	go install -tags netgo std && \
    24  	go install -race -tags netgo std
    25  RUN go get -tags netgo \
    26  		github.com/FiloSottile/gvt \
    27  		github.com/client9/misspell/cmd/misspell \
    28  		github.com/fatih/hclfmt \
    29  		github.com/fzipp/gocyclo \
    30  		github.com/gogo/protobuf/gogoproto \
    31  		github.com/gogo/protobuf/protoc-gen-gogoslick \
    32  		github.com/golang/dep/... \
    33  		golang.org/x/lint/golint \
    34  		github.com/golang/protobuf/protoc-gen-go \
    35  		github.com/kisielk/errcheck \
    36  		github.com/mjibson/esc \
    37  		github.com/prometheus/prometheus/cmd/promtool && \
    38  		rm -rf /go/pkg /go/src
    39  RUN mkdir protoc && \
    40  	cd protoc && \
    41  	curl -O -L https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip && \
    42  	unzip protoc-3.1.0-linux-x86_64.zip && \
    43  	cp bin/protoc /usr/bin/ && \
    44  	chmod o+x /usr/bin/protoc && \
    45  	cd .. && \
    46  	rm -rf protoc
    47  RUN mkdir -p /var/run/secrets/kubernetes.io/serviceaccount && \
    48  		touch /var/run/secrets/kubernetes.io/serviceaccount/token
    49  COPY build.sh /
    50  ENTRYPOINT ["/build.sh"]
    51  
    52  ARG revision
    53  LABEL maintainer="Weaveworks <help@weave.works>" \
    54        org.opencontainers.image.title="golang" \
    55        org.opencontainers.image.source="https://github.com/weaveworks/build-tools/tree/master/build/golang" \
    56        org.opencontainers.image.revision="${revision}" \
    57        org.opencontainers.image.vendor="Weaveworks"