Merge remote-tracking branch 'origin/lance/buf' into staging

This commit is contained in:
Anton Livaja 2024-05-03 22:41:49 -04:00
commit d848bae5e0
No known key found for this signature in database
GPG key ID: 44A86CFF1FDF0E85
2 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,36 @@
FROM scratch as base
ENV VERSION=1.30.1
ENV SRC_HASH=56da0c31b11bd15b99049af8b364c7bf4e11106152ab27d5ccb98d28123ab785
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/bufbuild/buf/archive/refs/tags/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/go . /
COPY --from=stagex/ca-certificates . /
RUN tar -xvf v${VERSION}.tar.gz
WORKDIR buf-${VERSION}
ENV PWD=/home/user/buf-${VERSION}
ENV GOPATH=${PWD}/cache/go
ENV GOCACHE=${PWD}/cache/
ENV GOWORK=off
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV GOFLAGS=-trimpath
RUN mkdir -p ${GOPATH}
RUN go build -o bin/buf ./cmd/buf
from build as install
RUN <<-EOF
mkdir -p /rootfs/usr/bin/
cp bin/buf /rootfs/usr/bin/
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/./ /

View file

@ -151,6 +151,16 @@ out/bison/index.json: \
out/perl/index.json
$(call build,bison)
.PHONY: buf
buf: out/buf/index.json
out/buf/index.json: \
packages/buf/Containerfile \
out/busybox/index.json \
out/ca-certificates/index.json \
out/filesystem/index.json \
out/go/index.json
$(call build,buf)
.PHONY: busybox
busybox: out/busybox/index.json
out/busybox/index.json: \