fix: .dockerignore makes git working tree dirty

The .github/workflows/release/Dockerfile will use working dir as docker
build context. But the .dockerignore will ignore the .github/release/...
and cause dirty. We should remove it and verify git working tree after
build.

Fix: #6484

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2022-02-07 23:31:14 +08:00
parent 4f5ce5615a
commit 7e821fb618
2 changed files with 5 additions and 4 deletions

View File

@ -1,4 +0,0 @@
.github/
.dockerignore
releases/
bin/

View File

@ -50,5 +50,10 @@ RUN \
make release cri-release cri-cni-release && \
for f in $(find bin -executable -type f); do xx-verify $f; done
# check git working tree after build
RUN \
export GIT_STATUS_OUTPUT=$(git status --porcelain) && \
test -z $GIT_STATUS_OUTPUT || (echo $GIT_STATUS_OUTPUT && exit 1)
FROM scratch AS release
COPY --from=target /go/src/github.com/containerd/containerd/releases/ /