Skip to content

Conversation

@lunny
Copy link
Member

@lunny lunny commented Jun 27, 2025

This PR use cache mounts feature of docker to accelerate the docker image build process.
ref: https://docs.docker.com/build/cache/optimize/#use-cache-mounts

Run docker build locally it will take about 242.8s and now it's 16s after cached.

TODO:

  • Add shared cache in CI/CD
    cache-from: type=registry,ref=gitea/gitea:buildcache-v1.24
    cache-to: type=registry,ref=gitea/gitea:buildcache-v1.24,mode=max

@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Jun 27, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 27, 2025
@wxiaoguang
Copy link
Contributor

-> Reduce incremental Docker build times #27998

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 27, 2025

One more thing, the rootful and rootless can share the some build and binaries. For example, build rootless first (or a common image first), then copy its binaries (gitea, environment-to-ini) to the rootful image.

(Just a hint, not a must)

@wxiaoguang
Copy link
Contributor

Why duplicate so many commands in the yaml, should the commands be in a script?

@TheFox0x7
Copy link
Contributor

@lunny are you still working on this?

@lunny
Copy link
Member Author

lunny commented Sep 29, 2025

@lunny are you still working on this?

I don't have time to continue working on this right now. Please feel free to take it over.

@lunny lunny closed this Oct 18, 2025
@lunny lunny deleted the lunny/docker_build_cache branch October 18, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/internal topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants