22 lines
596 B
Docker
22 lines
596 B
Docker
|
## build image:
|
||
|
FROM golang:1.19.3-bullseye AS builder
|
||
|
|
||
|
ENV DEBIAN_FRONTEND noninteractive
|
||
|
RUN apt update && apt install -y make bzip2 curl unzip
|
||
|
RUN mkdir -p /build
|
||
|
WORKDIR /build
|
||
|
|
||
|
# install newer protoc
|
||
|
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v21.10/protoc-21.10-linux-aarch_64.zip && \
|
||
|
unzip *.zip -d /usr/local && rm -v *.zip && protoc --version
|
||
|
|
||
|
RUN go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
|
||
|
|
||
|
RUN go env
|
||
|
|
||
|
COPY ./go.mod .
|
||
|
COPY ./go.sum .
|
||
|
|
||
|
RUN --mount=type=cache,target=/go/pkg go mod download -x
|
||
|
RUN rm -rfv /var/cache/* /var/tmp/*
|