github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/build-image/Dockerfile (about) 1 FROM golang:1.16.6-buster 2 ARG goproxyValue 3 ENV GOPROXY=${goproxyValue} 4 RUN apt-get update && apt-get install -y curl python-requests python-yaml file jq unzip protobuf-compiler libprotobuf-dev && \ 5 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 6 RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - 7 RUN apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 8 9 # Install website builder dependencies. Whenever you change these version, please also change website/package.json 10 # and viceversa. 11 RUN npm install -g postcss-cli@5.0.1 autoprefixer@9.8.5 12 13 ENV HUGO_VERSION=v0.72.0 14 RUN git clone https://github.com/gohugoio/hugo.git --branch ${HUGO_VERSION} --depth 1 && \ 15 cd hugo && go install --tags extended && cd ../ && \ 16 rm -rf hugo/ && rm -rf /go/pkg /go/src /root/.cache 17 18 ENV SHFMT_VERSION=3.2.4 19 RUN GOARCH=$(go env GOARCH) && \ 20 if [ "$GOARCH" = "amd64" ]; then \ 21 DIGEST=3f5a47f8fec27fae3e06d611559a2063f5d27e4b9501171dde9959b8c60a3538; \ 22 elif [ "$GOARCH" = "arm64" ]; then \ 23 DIGEST=6474d9cc08a1c9fe2ef4be7a004951998e3067d46cf55a011ddd5ff7bfab3de6; \ 24 fi && \ 25 URL=https://github.com/mvdan/sh/releases/download/v${SHFMT_VERSION}/shfmt_v${SHFMT_VERSION}_linux_${GOARCH}; \ 26 curl -fsSLo shfmt "${URL}" && \ 27 echo "$DIGEST shfmt" | sha256sum -c && \ 28 chmod +x shfmt && \ 29 mv shfmt /usr/bin 30 31 RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /usr/bin v1.27.0 32 33 RUN GO111MODULE=on go get \ 34 github.com/client9/misspell/cmd/misspell@v0.3.4 \ 35 github.com/golang/protobuf/protoc-gen-go@v1.3.1 \ 36 github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 \ 37 github.com/gogo/protobuf/gogoproto@v1.3.0 \ 38 github.com/weaveworks/tools/cover@bdd647e92546027e12cdde3ae0714bb495e43013 \ 39 github.com/fatih/faillint@v1.5.0 \ 40 github.com/campoy/embedmd@v1.0.0 \ 41 && rm -rf /go/pkg /go/src /root/.cache 42 43 ENV NODE_PATH=/usr/lib/node_modules 44 COPY build.sh / 45 ENV GOCACHE=/go/cache 46 ENTRYPOINT ["/build.sh"] 47 48 ARG revision 49 LABEL org.opencontainers.image.title="build-image" \ 50 org.opencontainers.image.source="https://github.com/cortexproject/cortex/tree/master/build-image" \ 51 org.opencontainers.image.revision="${revision}"