-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Dockerfile small refactor #27757
Dockerfile small refactor #27757
Conversation
nfsec
commented
Oct 23, 2023
•
edited by wxiaoguang
Loading
edited by wxiaoguang
- Size and layer optimization,
- Maintaining consistency in definitions (comments, apk etc.),
- Maintaining consistency - Size and layer optimization
Why rename "docker/root/usr/bin/entrypoint → docker/root/usr/bin/entrypoint.sh" ? If it is not a must, I would prefer to keep the old name to avoid breaking. "Shebang compatible extension for entrypoint (like in rootless)." I do not see it as a must, because naturely, the "rootless" is totally different from the "root" image, they can't be switched. |
Dockerfile
Outdated
RUN chmod 755 /usr/bin/entrypoint.sh \ | ||
/app/gitea/gitea \ | ||
/usr/local/bin/gitea \ | ||
/usr/local/bin/environment-to-ini \ | ||
/etc/s6/gitea/* \ | ||
/etc/s6/openssh/* \ | ||
/etc/s6/.s6-svscan/* |
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.
For "Size and layer optimization":
IIRC there is a bug in the chmod
step.
For example:
- "latest" 108M: https://hub.docker.com/layers/gitea/gitea/latest/images/sha256-c77a7cf73ad59dd09c3ada400bbf585d12a772e9867dc574d3cfdaa76f92bbcf?context=explore
- "1.21-nightly" 65M: https://hub.docker.com/layers/gitea/gitea/1.21-nightly/images/sha256-d0b0c740cb6b9f0a0d381199dd2084d6a4a27c5a528750e0d80a043a3b43ec04?context=explore
The problem is the RUN /bin/sh -c chmod 755
layer introduces another 44M change in "latest" image.
I think we should do chmod for the built binaries in the build-env
stage, then the chmod
layer won't cause so much a big change.
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.
Moved chmod
to build-env.
Okey. Switched back to none-file-extension. |
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.
Overall LGTM (not tested yet).
Leave it some days for more reviews & feedbacks.
If no more change request, wait to merge. |
- Size and layer optimization, - Maintaining consistency in definitions (comments, apk etc.),
* giteaofficial/main: List all Debian package versions in `Packages` (go-gitea#27786) Fix merge base commit for fast-forwarded GitLab PRs (go-gitea#27825) Fix bad method call when deleting user secrets via API (go-gitea#27829) Change katex limits (go-gitea#27823) Dockerfile small refactor (go-gitea#27757) Use GitLab's squash_commit_sha when available (go-gitea#27824) [skip ci] Updated translations via Crowdin Upgrade xorm to 1.3.4 (go-gitea#27807)
- Size and layer optimization, - Maintaining consistency in definitions (comments, apk etc.),