Merge remote-tracking branch 'origin/lance/buf' into staging
This commit is contained in:
commit
d848bae5e0
2 changed files with 46 additions and 0 deletions
36
packages/buf/Containerfile
Normal file
36
packages/buf/Containerfile
Normal 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/./ /
|
|
@ -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: \
|
||||
|
|
Loading…
Reference in a new issue