feat(go): replace Alpine with Debian base
All checks were successful
agola/ci-images/Build The run finished successfully

This commit is contained in:
Peter 2022-10-12 19:13:27 +02:00
parent 401ce7c4c3
commit d9f7d33a9e
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9

View file

@ -1,42 +1,39 @@
FROM docker.io/golang:1.19-alpine
FROM docker.io/golang:1.19-bullseye as tools
# install basic dependencies
RUN apk add -U --no-cache \
docker \
protobuf-dev \
findutils \
git \
RUN go install github.com/golang/mock/mockgen@latest && \
go install github.com/Helcaraxan/gomod@latest && \
go install gotest.tools/gotestsum@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install mvdan.cc/gofumpt@latest && \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
FROM docker.io/golang:1.19-bullseye
RUN apt-get update && \
apt-get install \
-y \
git-lfs \
ca-certificates \
graphviz \
curl\
gcc \
musl-dev \
curl \
jq \
libbpf \
libbpf-dev \
clang \
llvm12 \
elfutils \
linux-headers
llvm-13 \
elfutils && \
rm -rf /var/lib/apt/lists/* && \
ln -s /usr/bin/llc-13 /usr/bin/llc
# Install GoReleaser
RUN export GORELEASER_VERSION=$(curl https://api.github.com/repos/goreleaser/goreleaser/releases | jq -r '. | first |.tag_name | capture("(?<version>[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+)") | .version') && \
curl -Lo /tmp/goreleaser.apk "https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_${GORELEASER_VERSION}_x86_64.apk" && \
apk add --allow-untrusted /tmp/goreleaser.apk && \
rm -f /tmp/*.apk && \
curl -Lo /tmp/goreleaser.deb "https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_${GORELEASER_VERSION}_amd64.deb" && \
apt install /tmp/goreleaser.deb && \
rm -f /tmp/*.deb && \
goreleaser --version
COPY --from=tools /go/bin/* /usr/local/bin/
# Install go tools
RUN go install github.com/golang/mock/mockgen@latest \
&& go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
&& go install github.com/Helcaraxan/gomod@latest \
&& go install gotest.tools/gotestsum@latest \
&& go install golang.org/x/tools/cmd/goimports@latest \
&& go install mvdan.cc/gofumpt@latest \
&& go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest \
&& curl -L https://github.com/go-task/task/releases/latest/download/task_linux_amd64.tar.gz | tar -xvz -C /usr/local/bin task \
RUN curl -L https://github.com/go-task/task/releases/latest/download/task_linux_amd64.tar.gz | tar -xvz -C /usr/local/bin task \
&& export BUF_VERSION=$(curl https://api.github.com/repos/bufbuild/buf/releases | jq -r '. | first |.tag_name') && \
curl -Lo /usr/bin/buf "https://github.com/bufbuild/buf/releases/download/${BUF_VERSION}/buf-Linux-x86_64" \
&& chmod +x /usr/bin/buf \