-
-
Couldn't load subscription status.
- Fork 6.2k
Add cache to container build #35697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add cache to container build #35697
Changes from all commits
062c5f4
48c432d
afba5ff
b9bc1b8
efb558a
4b70dd9
b4fc88b
da539d8
2421538
2f9e047
db78470
5a927c5
1c08d25
c8abefb
37cf5db
fe925c1
1218db2
1aa245f
0551e5b
449d2b4
1d5345d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -66,7 +66,7 @@ jobs: | |||
| gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/* | ||||
| env: | ||||
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||||
| docker-rootful: | ||||
| container: | ||||
| runs-on: namespace-profile-gitea-release-docker | ||||
| permissions: | ||||
| packages: write # to publish to ghcr.io | ||||
|
|
@@ -88,38 +88,10 @@ jobs: | |||
| # 1.2.3-rc0 | ||||
| tags: | | ||||
| type=semver,pattern={{version}} | ||||
| - name: Login to Docker Hub | ||||
| uses: docker/login-action@v3 | ||||
| with: | ||||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||
| - name: Login to GHCR using PAT | ||||
| uses: docker/login-action@v3 | ||||
| with: | ||||
| registry: ghcr.io | ||||
| username: ${{ github.repository_owner }} | ||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||
| - name: build rootful docker image | ||||
| uses: docker/build-push-action@v5 | ||||
| with: | ||||
| context: . | ||||
| platforms: linux/amd64,linux/arm64,linux/riscv64 | ||||
| push: true | ||||
| tags: ${{ steps.meta.outputs.tags }} | ||||
| labels: ${{ steps.meta.outputs.labels }} | ||||
| docker-rootless: | ||||
| runs-on: namespace-profile-gitea-release-docker | ||||
| permissions: | ||||
| packages: write # to publish to ghcr.io | ||||
| steps: | ||||
| - uses: actions/checkout@v5 | ||||
| # fetch all commits instead of only the last as some branches are long lived and could have many between versions | ||||
| # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 | ||||
| - run: git fetch --unshallow --quiet --tags --force | ||||
| - uses: docker/setup-qemu-action@v3 | ||||
| - uses: docker/setup-buildx-action@v3 | ||||
| annotations: | | ||||
| org.opencontainers.image.authors="maintainers@gitea.io" | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just add this to the Dockerfiles instead: LABEL org.opencontainers.image.authors="maintainers@gitea.io"Ref: https://docs.docker.com/reference/build-checks/maintainer-deprecated/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note, Dockerfiles do already have a Line 45 in 8085c75
It's probably better to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved it to tag generation to avoid having implicitly marking user built containers as maintained by gitea, but I can move back into the container if it's not a concern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm makes sense your way I guess. Would just like to avoid duplication. |
||||
| - uses: docker/metadata-action@v5 | ||||
| id: meta | ||||
| id: meta_rootless | ||||
| with: | ||||
| images: |- | ||||
| gitea/gitea | ||||
|
|
@@ -131,6 +103,8 @@ jobs: | |||
| # 1.2.3-rc0 | ||||
| tags: | | ||||
| type=semver,pattern={{version}} | ||||
| annotations: | | ||||
| org.opencontainers.image.authors="maintainers@gitea.io" | ||||
| - name: Login to Docker Hub | ||||
| uses: docker/login-action@v3 | ||||
| with: | ||||
|
|
@@ -142,12 +116,20 @@ jobs: | |||
| registry: ghcr.io | ||||
| username: ${{ github.repository_owner }} | ||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||
| - name: build rootless docker image | ||||
| - name: build regular container image | ||||
| uses: docker/build-push-action@v5 | ||||
| with: | ||||
| context: . | ||||
| platforms: linux/amd64,linux/arm64,linux/riscv64 | ||||
| push: true | ||||
| file: Dockerfile.rootless | ||||
| tags: ${{ steps.meta.outputs.tags }} | ||||
| labels: ${{ steps.meta.outputs.labels }} | ||||
| annotations: ${{ steps.meta.outputs.annotations }} | ||||
| - name: build rootless container image | ||||
| uses: docker/build-push-action@v5 | ||||
| with: | ||||
| context: . | ||||
| platforms: linux/amd64,linux/arm64,linux/riscv64 | ||||
| push: true | ||||
| file: Dockerfile.rootless | ||||
| tags: ${{ steps.meta_rootless.outputs.tags }} | ||||
| annotations: ${{ steps.meta_rootless.outputs.annotations }} | ||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no leading slash? Imho it's better to exactly ignore these files in the root, not ignore them anywhere in the tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think maybe they don't need to be ignored? I guess there should be nothing wrong by keeping them