mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #72] Provide minimal docker image and binaries, possibly split docs to its own package. #60
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jauderho on GitHub (Dec 29, 2021).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/72
I was trying to compile my own container image using the following build command:
go build -o ntfy -v -trimpath -ldflags="-s -w -X main.version=v1.10.0" .This failed with the error message of
server/server.go:116:13: pattern docs: no matching files foundwhich appears to be a go:embed directive for docs. Removing this line allows for the compilation to successfully complete.Here's the line in question:
github.com/binwiederhier/ntfy@9752bd7c30/server/server.go (L116)@binwiederhier commented on GitHub (Dec 29, 2021):
@jauderho Ah yes, I'm sorry I had this the other day and it drove me mad, but I forgot to fix it:
make docswill fix it.You have to install
mkdocs.@binwiederhier commented on GitHub (Dec 29, 2021):
My apologies this is so hard, I should make a github action that does the full build as an example. I haven't done a clean build in a while.
@binwiederhier commented on GitHub (Dec 29, 2021):
Should be enough to do
pip install -r requirements.txt@jauderho commented on GitHub (Dec 29, 2021):
@binwiederhier I don't suppose there is a way to avoid having to do the mkdocs step? I'm looking to build a minimal image which is why I was going with the singular build command. Removing that line seemed to allow the build to complete.
I suppose I could use a small patch to patch that out.
@binwiederhier commented on GitHub (Dec 29, 2021):
@jauderho I'm happy to accept PRs and adjust the build to fit your needs, but removing the go:embed line basically removes the docs entirely and will likely lead to horrible errors. You could create an empty folder
server/docs/, that would probably do it.@jauderho commented on GitHub (Dec 30, 2021):
I just tried your suggestion of creating an empty
server/docs/but still run into the same error. Any other ideas?I suppose I could just add the necessary commands to build the docs. Brb, editing Dockerfile.
@binwiederhier commented on GitHub (Dec 30, 2021):
I just pushed this:
github.com/binwiederhier/ntfy@96ad49f675This makes
make build-simplework again. I think you could do something similar with the other targets, or create a target without docs. I thinkmakeis a little limited in that sense, but myMakefileis also a little stupid to be honest.Anyway, I gotta go to bed. It's late. I can help more tomorrow.
@jauderho commented on GitHub (Dec 30, 2021):
Having the dummy file did the trick! I ended up building the container both with and without docs and there's about 11MB in difference in the final image.
Anyways, I now have a working image for different archs: https://hub.docker.com/repository/docker/jauderho/ntfy
Dockerfile here: https://github.com/jauderho/dockerfiles/blob/main/ntfy/Dockerfile
@binwiederhier commented on GitHub (Dec 30, 2021):
I could probably build a ntfy-minimal image using the GoReleaser stuff. If that's something you desire. 🤷 Not any time soon though (too much other stuff).
@jauderho commented on GitHub (Dec 31, 2021):
If you are willing to have a server/docs/dummy stub in your repo, I can create a basic .goreleaser.yml that should do the right thing.
This one should work (tested): https://gist.github.com/jauderho/451d1ca80c7734c51ef47ea87672d1e1
I can submit as a pull request if needed.
@binwiederhier commented on GitHub (Dec 31, 2021):
Thank you for the contribution. I if you can modify the existing GoReleaser file to build two images, one normal and one minimal would be fantastic.
@binwiederhier commented on GitHub (Mar 18, 2022):
I've overhauled the developer documentation (see https://github.com/binwiederhier/ntfy/blob/main/docs/develop.md), but I don't think I want to provide additional minimal packages for now. I realize that 17 MB as opposed to 7 MB is not great, but I think it's fine. If you feel strongly I may change my mind though. Closing this ticket for now.