From 984927ae5630083f9c2b5cfa6ced186c565ef8bd Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sun, 8 Dec 2024 13:59:35 +0100 Subject: [PATCH] scripts/build-container.sh: Use specific buildkit image version Reproducibility also depends on using the same buildkit version as the pipeline. E.g., v0.13.0 and v0.16.0 generate different tar archives. We are currently on v0.16.0 in the pipeline, enforce this also locally. Signed-off-by: Jan Kiszka --- scripts/build-container.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/build-container.sh b/scripts/build-container.sh index 0a3a1bfe..a725e857 100755 --- a/scripts/build-container.sh +++ b/scripts/build-container.sh @@ -25,6 +25,9 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +# This needs to be aligned with .github/actions/docker-init/action.yml +BUILDKIT="moby/buildkit:v0.16.0" + usage() { DEFAULT_DEBIAN_TAG=$(grep -m 1 'ARG DEBIAN_TAG=' "$(dirname "$0")/../Dockerfile" | @@ -130,6 +133,11 @@ if [ "$CLEAN" = y ]; then done fi +if ! docker buildx inspect | grep -q "Driver Options:.*$BUILDKIT"; then + BUILDX_INSTANCE=$(docker buildx create --driver-opt image="$BUILDKIT") + docker buildx use "$BUILDX_INSTANCE" +fi + KAS_CLONE=$(mktemp -d --tmpdir kas-tmp.XXXXXXXXXX) git clone . "$KAS_CLONE" cd "$KAS_CLONE" || exit 1