From 42dffaaa4ebeabda38d14967836128042226c35f Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 8 Feb 2023 19:38:49 -0800 Subject: [PATCH] Dockerfile: fix build wrt new git With the updated git in golang:1.19-bullseye image, building fails with: make -C /go/src/github.com/opencontainers/runc PKG_CONFIG_PATH=/opt/libseccomp/lib/pkgconfig COMMIT_NO= EXTRA_FLAGS=-a 'EXTRA_LDFLAGS=-w -s -buildid=' static make[1]: Entering directory '/go/src/github.com/opencontainers/runc' fatal: detected dubious ownership in repository at '/go/src/github.com/opencontainers/runc' To add an exception for this directory, call: git config --global --add safe.directory /go/src/github.com/opencontainers/runc go build -trimpath -buildmode=pie -a -tags "seccomp urfave_cli_no_docs netgo osusergo" -ldflags "-X main.gitCommit= -X main.version=1.1.0+dev -linkmode external -extldflags --static-pie -w -s -buildid=" -o runc . error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping. This commit should fix it. Signed-off-by: Kir Kolyshkin --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 934883405..1504b4b1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,4 +58,7 @@ ENV LIBSECCOMP_VERSION=$LIBSECCOMP_VERSION ENV LD_LIBRARY_PATH=/opt/libseccomp/lib ENV PKG_CONFIG_PATH=/opt/libseccomp/lib/pkgconfig +# Prevent the "fatal: detected dubious ownership in repository" git complain during build. +RUN git config --global --add safe.directory /go/src/github.com/opencontainers/runc + WORKDIR /go/src/github.com/opencontainers/runc