Merge pull request #2690 from crazy-max/ci-buildinfo-attrs

ci: opt-in buildinfo attrs with output opt
master
Tõnis Tiigi 2022-03-02 08:26:45 -08:00 committed by GitHub
commit 1d66f6f174
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# syntax = docker/dockerfile-upstream:master # syntax=docker/dockerfile-upstream:master
ARG RUNC_VERSION=v1.0.2 ARG RUNC_VERSION=v1.0.2
ARG CONTAINERD_VERSION=v1.6.0 ARG CONTAINERD_VERSION=v1.6.0

View File

@ -1,4 +1,4 @@
# syntax = docker/dockerfile:1.3 # syntax=docker/dockerfile-upstream:master
# xx is a helper for cross-compilation # xx is a helper for cross-compilation
FROM --platform=$BUILDPLATFORM tonistiigi/xx:golang@sha256:810dc54d5144f133a218e88e319184bf8b9ce01d37d46ddb37573e90decd9eef AS xx FROM --platform=$BUILDPLATFORM tonistiigi/xx:golang@sha256:810dc54d5144f133a218e88e319184bf8b9ce01d37d46ddb37573e90decd9eef AS xx

View File

@ -87,7 +87,7 @@ case $TYP in
buildxCmd build $platformFlag $cacheFromFlags $cacheToFlags \ buildxCmd build $platformFlag $cacheFromFlags $cacheToFlags \
--build-arg "CHANNEL=$TAG" \ --build-arg "CHANNEL=$TAG" \
--build-arg "BUILDTAGS=$buildTags" \ --build-arg "BUILDTAGS=$buildTags" \
--output "type=image,name=$REPO:$pushTag,$pushFlag" \ --output "type=image,name=$REPO:$pushTag,buildinfo-attrs=true,$pushFlag" \
--file "./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile" \ --file "./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile" \
$currentcontext $currentcontext
;; ;;
@ -104,7 +104,7 @@ case $TYP in
buildxCmd build $platformFlag $cacheFromFlags $cacheToFlags \ buildxCmd build $platformFlag $cacheFromFlags $cacheToFlags \
--build-arg "CHANNEL=$TAG" \ --build-arg "CHANNEL=$TAG" \
--build-arg "BUILDTAGS=$buildTags" \ --build-arg "BUILDTAGS=$buildTags" \
--output "type=image,\"name=$publishedNames\",$pushFlag" \ --output "type=image,\"name=$publishedNames\",buildinfo-attrs=true,$pushFlag" \
--file "./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile" \ --file "./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile" \
$currentcontext $currentcontext
;; ;;
@ -144,7 +144,7 @@ case $TYP in
buildxCmd build $platformFlag $cacheFromFlags $cacheToFlags \ buildxCmd build $platformFlag $cacheFromFlags $cacheToFlags \
--build-arg "CHANNEL=$TAG" \ --build-arg "CHANNEL=$TAG" \
--build-arg "BUILDTAGS=$buildTags" \ --build-arg "BUILDTAGS=$buildTags" \
--output "type=image,name=$REPO:$dt-$TAG,$pushFlag" \ --output "type=image,name=$REPO:$dt-$TAG,buildinfo-attrs=true,$pushFlag" \
--file "./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile" \ --file "./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile" \
$currentcontext $currentcontext
rm $tmp/buildid rm $tmp/buildid

View File

@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.3 # syntax=docker/dockerfile-upstream:master
# protoc is dynamically linked to glibc to can't use golang:1.10-alpine # protoc is dynamically linked to glibc to can't use golang:1.10-alpine
FROM golang:1.17-buster AS gobuild-base FROM golang:1.17-buster AS gobuild-base

View File

@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.3 # syntax=docker/dockerfile-upstream:master
FROM golang:1.17-alpine FROM golang:1.17-alpine
RUN apk add --no-cache gcc musl-dev yamllint RUN apk add --no-cache gcc musl-dev yamllint

View File

@ -1,4 +1,4 @@
# syntax = docker/dockerfile:1.3 # syntax=docker/dockerfile-upstream:master
FROM mvdan/shfmt:v3.1.2-alpine AS shfmt FROM mvdan/shfmt:v3.1.2-alpine AS shfmt
WORKDIR /src WORKDIR /src
ARG SHFMT_FLAGS="-i 2 -ci" ARG SHFMT_FLAGS="-i 2 -ci"

View File

@ -1,4 +1,4 @@
# syntax = docker/dockerfile:1.3 # syntax=docker/dockerfile-upstream:master
FROM golang:1.17-alpine AS vendored FROM golang:1.17-alpine AS vendored
RUN apk add --no-cache git RUN apk add --no-cache git

View File

@ -41,10 +41,10 @@ fi
outputFlag="--output=type=image,push=false" outputFlag="--output=type=image,push=false"
if [ "$PUSH" = "push" ]; then if [ "$PUSH" = "push" ]; then
outputFlag="--output=type=image,push=true" outputFlag="--output=type=image,buildinfo-attrs=true,push=true"
fi fi
if [ -n "$localmode" ]; then if [ -n "$localmode" ]; then
outputFlag="--output=type=docker" outputFlag="--output=type=docker,buildinfo-attrs=true"
fi fi
targetFlag="" targetFlag=""

View File

@ -59,5 +59,5 @@ if [ "$GITHUB_ACTIONS" = "true" ]; then
fi fi
fi fi
if [ -n "$currentref" ]; then if [ -n "$currentref" ]; then
currentcontext="--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 --build-arg BUILDKIT_INLINE_BUILDINFO_ATTRS=1 $currentref" currentcontext="--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 $currentref"
fi fi