2023-02-07 19:47:29 +00:00
|
|
|
FROM docker.io/golang:1.20-bullseye as tools
|
2022-09-29 19:06:16 +00:00
|
|
|
|
2022-10-12 17:13:27 +00:00
|
|
|
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 && \
|
2022-12-21 20:50:37 +00:00
|
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
|
|
|
|
go install github.com/google/ko@latest
|
2022-10-12 17:13:27 +00:00
|
|
|
|
2022-10-12 20:11:52 +00:00
|
|
|
FROM docker.io/ubuntu:22.04
|
2022-10-12 17:13:27 +00:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install \
|
|
|
|
-y \
|
2022-09-29 19:06:16 +00:00
|
|
|
git-lfs \
|
2022-10-12 17:13:27 +00:00
|
|
|
curl\
|
2022-09-29 19:06:16 +00:00
|
|
|
gcc \
|
|
|
|
jq \
|
|
|
|
libbpf-dev \
|
|
|
|
clang \
|
2022-10-12 17:13:27 +00:00
|
|
|
llvm-13 \
|
|
|
|
elfutils && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
2022-10-12 20:11:52 +00:00
|
|
|
ln -s /usr/bin/llc-14 /usr/bin/llc
|
|
|
|
|
|
|
|
# Install Go
|
2023-05-24 20:15:00 +00:00
|
|
|
RUN curl -L https://go.dev/dl/go1.20.4.linux-amd64.tar.gz | tar -xvz -C /usr/local
|
2022-10-12 20:11:52 +00:00
|
|
|
|
|
|
|
ENV PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
|
|
|
GOPATH=/go
|
2022-09-29 19:06:16 +00:00
|
|
|
|
|
|
|
# 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') && \
|
2022-10-12 17:13:27 +00:00
|
|
|
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 && \
|
2022-09-29 19:06:16 +00:00
|
|
|
goreleaser --version
|
|
|
|
|
2022-10-12 17:13:27 +00:00
|
|
|
COPY --from=tools /go/bin/* /usr/local/bin/
|
|
|
|
|
2022-09-29 19:06:16 +00:00
|
|
|
# Install go tools
|
2022-10-12 17:13:27 +00:00
|
|
|
RUN curl -L https://github.com/go-task/task/releases/latest/download/task_linux_amd64.tar.gz | tar -xvz -C /usr/local/bin task \
|
2022-09-29 19:06:16 +00:00
|
|
|
&& 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 \
|
|
|
|
&& go version \
|
|
|
|
&& golangci-lint --version \
|
|
|
|
&& task --version \
|
|
|
|
&& buf --version
|