[PR #754] [MERGED] Add a way to use Docker for building everything #1407

Closed
opened 2026-05-07 01:01:58 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/754
Author: @nimbleghost
Created: 5/26/2023
Status: Merged
Merged: 5/26/2023
Merged by: @binwiederhier

Base: mainHead: docker-local-build


📝 Commits (2)

  • 232c889 Use apt-get in makefile
  • 11f8984 Add a way to use Docker for building everything

📊 Changes

4 files changed (+83 additions, -5 deletions)

View changed files

.dockerignore (+3 -0)
Dockerfile-build (+53 -0)
📝 Makefile (+18 -5)
📝 docs/develop.md (+9 -0)

📄 Description

Add a way to use Docker for building everything

I’d like to test #751 on my own instance, but installing all the build
dependencies on my server isn’t ideal - having this script in the repo
would make it possible to simply point my compose file to the git repo
and have it build the Linux binary itself.

Note that it uses a somewhat “inefficient” builder step, i.e. not
combining steps together to reduce layers, as it uses a multi-stage
build to have a lean final image. This makes it easier to re-build if
something needs to change, as the cache is used more optimally.

For example, if only some go files change, most of the build is already
cached and only the go step gets re-run.

The more “efficient” builder step would look like this, but would have
to build the docs, web app and go CLI for any change in any file:

FROM golang:1.19-bullseye as builder

RUN apt-get update && \
    curl -fsSL https://deb.nodesource.com/setup_18.x | bash && \
    apt-get install -y \
    build-essential \
    nodejs \
    python3-pip

WORKDIR /app
ADD . .

RUN make web docs cli-linux-server

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/754 **Author:** [@nimbleghost](https://github.com/nimbleghost) **Created:** 5/26/2023 **Status:** ✅ Merged **Merged:** 5/26/2023 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `docker-local-build` --- ### 📝 Commits (2) - [`232c889`](https://github.com/binwiederhier/ntfy/commit/232c889ce31f825c72b645f63cc262d69c32ca1e) Use `apt-get` in makefile - [`11f8984`](https://github.com/binwiederhier/ntfy/commit/11f898412748f4477caf8b260e0575cb768091dc) Add a way to use Docker for building everything ### 📊 Changes **4 files changed** (+83 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `.dockerignore` (+3 -0) ➕ `Dockerfile-build` (+53 -0) 📝 `Makefile` (+18 -5) 📝 `docs/develop.md` (+9 -0) </details> ### 📄 Description Add a way to use Docker for building everything I’d like to test #751 on my own instance, but installing all the build dependencies on my server isn’t ideal - having this script in the repo would make it possible to simply point my compose file to the git repo and have it build the Linux binary itself. Note that it uses a somewhat “inefficient” builder step, i.e. not combining steps together to reduce layers, as it uses a multi-stage build to have a lean final image. This makes it easier to re-build if something needs to change, as the cache is used more optimally. For example, if only some go files change, most of the build is already cached and only the go step gets re-run. The more “efficient” builder step would look like this, but would have to build the docs, web app and go CLI for any change in any file: ```Dockerfile FROM golang:1.19-bullseye as builder RUN apt-get update && \ curl -fsSL https://deb.nodesource.com/setup_18.x | bash && \ apt-get install -y \ build-essential \ nodejs \ python3-pip WORKDIR /app ADD . . RUN make web docs cli-linux-server ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:01:58 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1407
No description provided.