Skip to content

Commit 28ed763

Browse files
Use Actions git context instead of dynamically created buildkit one (#25381) (#25383)
Backport #25381 by @techknowlogick The [docker/build-push-action@v2 action](https://github.com/docker/build-push-action) by default ignores the checkout created using the actions/checkout@v2 action. When you pass a git build context to docker build, it wouldn't include the .git directory. By passing `context: .` to the build step then it'll use the Actions git context which includes the git fetch from the earlier step. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1 parent 8e89eb8 commit 28ed763

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

.github/workflows/release-nightly.yml

+2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ jobs:
7878
- name: build rootful docker image
7979
uses: docker/build-push-action@v4
8080
with:
81+
context: .
8182
platforms: linux/amd64,linux/arm64
8283
push: true
8384
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
8485
- name: build rootless docker image
8586
uses: docker/build-push-action@v4
8687
with:
88+
context: .
8789
platforms: linux/amd64,linux/arm64
8890
push: true
8991
file: Dockerfile.rootless

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -1001,9 +1001,5 @@ docker:
10011001
docker build --disable-content-trust=false -t $(DOCKER_REF) .
10021002
# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" .
10031003

1004-
.PHONY: docker-build
1005-
docker-build:
1006-
docker run -ti --rm -v "$(CURDIR):/srv/app/src/code.gitea.io/gitea" -w /srv/app/src/code.gitea.io/gitea -e TAGS="bindata $(TAGS)" LDFLAGS="$(LDFLAGS)" CGO_EXTRA_CFLAGS="$(CGO_EXTRA_CFLAGS)" webhippie/golang:edge make clean build
1007-
10081004
# This endif closes the if at the top of the file
10091005
endif

0 commit comments

Comments
 (0)