feat(go): replace Alpine with Debian base
All checks were successful
agola/ci-images/Build The run finished successfully
All checks were successful
agola/ci-images/Build The run finished successfully
This commit is contained in:
parent
401ce7c4c3
commit
d9f7d33a9e
1 changed files with 24 additions and 27 deletions
|
@ -1,42 +1,39 @@
|
||||||
FROM docker.io/golang:1.19-alpine
|
FROM docker.io/golang:1.19-bullseye as tools
|
||||||
|
|
||||||
# install basic dependencies
|
RUN go install github.com/golang/mock/mockgen@latest && \
|
||||||
RUN apk add -U --no-cache \
|
go install github.com/Helcaraxan/gomod@latest && \
|
||||||
docker \
|
go install gotest.tools/gotestsum@latest && \
|
||||||
protobuf-dev \
|
go install golang.org/x/tools/cmd/goimports@latest && \
|
||||||
findutils \
|
go install mvdan.cc/gofumpt@latest && \
|
||||||
git \
|
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 \
|
git-lfs \
|
||||||
ca-certificates \
|
curl\
|
||||||
graphviz \
|
|
||||||
gcc \
|
gcc \
|
||||||
musl-dev \
|
|
||||||
curl \
|
|
||||||
jq \
|
jq \
|
||||||
libbpf \
|
|
||||||
libbpf-dev \
|
libbpf-dev \
|
||||||
clang \
|
clang \
|
||||||
llvm12 \
|
llvm-13 \
|
||||||
elfutils \
|
elfutils && \
|
||||||
linux-headers
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
ln -s /usr/bin/llc-13 /usr/bin/llc
|
||||||
|
|
||||||
# Install GoReleaser
|
# 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') && \
|
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" && \
|
curl -Lo /tmp/goreleaser.deb "https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_${GORELEASER_VERSION}_amd64.deb" && \
|
||||||
apk add --allow-untrusted /tmp/goreleaser.apk && \
|
apt install /tmp/goreleaser.deb && \
|
||||||
rm -f /tmp/*.apk && \
|
rm -f /tmp/*.deb && \
|
||||||
goreleaser --version
|
goreleaser --version
|
||||||
|
|
||||||
|
COPY --from=tools /go/bin/* /usr/local/bin/
|
||||||
|
|
||||||
# Install go tools
|
# Install go tools
|
||||||
RUN go install github.com/golang/mock/mockgen@latest \
|
RUN curl -L https://github.com/go-task/task/releases/latest/download/task_linux_amd64.tar.gz | tar -xvz -C /usr/local/bin task \
|
||||||
&& 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 \
|
|
||||||
&& export BUF_VERSION=$(curl https://api.github.com/repos/bufbuild/buf/releases | jq -r '. | first |.tag_name') && \
|
&& 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" \
|
curl -Lo /usr/bin/buf "https://github.com/bufbuild/buf/releases/download/${BUF_VERSION}/buf-Linux-x86_64" \
|
||||||
&& chmod +x /usr/bin/buf \
|
&& chmod +x /usr/bin/buf \
|
||||||
|
|
Loading…
Reference in a new issue