From 7e127d06345b679b83279c322416d9cb3f9f190b Mon Sep 17 00:00:00 2001 From: N3WK1D Date: Fri, 22 Dec 2023 23:38:32 -0600 Subject: [PATCH 01/10] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..d657a63 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From e1c680e992cfc42999944dda3be96ba743610a11 Mon Sep 17 00:00:00 2001 From: N3WK1D Date: Fri, 22 Dec 2023 23:42:11 -0600 Subject: [PATCH 02/10] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d657a63..c26966b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,4 +15,4 @@ jobs: steps: - uses: actions/checkout@v3 - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + run: docker build . --tag ntfy:$(date +%s) From cf21a848adfbc975ee77a9c7172a3287cb7b8316 Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 17:12:00 -0600 Subject: [PATCH 03/10] Update docker-image.yml Minor fix to hopefully make the build action work. --- .github/workflows/docker-image.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c26966b..c58db5b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,12 +7,9 @@ on: branches: [ "main" ] jobs: - build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Build the Docker image - run: docker build . --tag ntfy:$(date +%s) + run: docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" -t ntfy:latest . From 925190000c377e98306b2f6568240c67f1668cf1 Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 17:20:00 -0600 Subject: [PATCH 04/10] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c58db5b..74ab1c5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -10,6 +10,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@main - name: Build the Docker image run: docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" -t ntfy:latest . From 3ce13306a519479783472113c7b68059a94b135e Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 17:29:01 -0600 Subject: [PATCH 05/10] Add '-' to tar command --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba25059..588cbb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN \ curl -o \ /tmp/ntfy.tar.gz -L \ "https://github.com/binwiederhier/ntfy/releases/download/${NTFY_RELEASE}/${NTFY_ARCH}.tar.gz" && \ - tar zxf \ + tar -zxf \ /tmp/ntfy.tar.gz -C /tmp/ntfy && \ cp -a /tmp/ntfy/"${NTFY_ARCH}"/ntfy /usr/bin/ntfy && \ echo "**** clean up ****" && \ From 7a71d520a262dbce0f34336e8bbf799a68c2890f Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 17:34:23 -0600 Subject: [PATCH 06/10] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 588cbb4..cfa3768 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN \ NTFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/binwiederhier/ntfy/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ if [ -z ${NTFY_ARCH+x} ]; then \ - NTFY_ARCH="ntfy_2.7.0_linux_amd64"; \ + NTFY_ARCH="ntfy_2.8.0_linux_amd64"; \ fi && \ curl -o \ /tmp/ntfy.tar.gz -L \ From a3a7db6ddf64ce1ab509e85be0d9f1022d739ba8 Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 18:12:09 -0600 Subject: [PATCH 07/10] Update docker-image.yml --- .github/workflows/docker-image.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 74ab1c5..e8ace85 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Docker Image CI +name: Docker Image CI for GHCR on: push: @@ -7,9 +7,12 @@ on: branches: [ "main" ] jobs: - build: + build_and_publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@main - - name: Build the Docker image - run: docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" -t ntfy:latest . + - name: Build and publish the Docker image to GHCR + run: + docker login --username raycadle --password ${{ secrets.GH_PAT }} ghcr.io + docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" --tag ghcr.io/raycadle/ntfy:latest . + docker push ghcr.io/raycadle/ntfy:latest From 14b1b9934634db241f390c8040853f0b967af680 Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 18:16:36 -0600 Subject: [PATCH 08/10] Added pipe to run directive --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e8ace85..5b7b555 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@main - name: Build and publish the Docker image to GHCR - run: + run: | docker login --username raycadle --password ${{ secrets.GH_PAT }} ghcr.io docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" --tag ghcr.io/raycadle/ntfy:latest . docker push ghcr.io/raycadle/ntfy:latest From 56635aa2d8101ecb384f92ee7ff4fe77483c45ef Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 18:51:01 -0600 Subject: [PATCH 09/10] Removed hardcoded arch version for ntfy download --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cfa3768..a6a0c8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN \ NTFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/binwiederhier/ntfy/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ if [ -z ${NTFY_ARCH+x} ]; then \ - NTFY_ARCH="ntfy_2.8.0_linux_amd64"; \ + NTFY_ARCH="ntfy_${NTFY_RELEASE/v/}_linux_amd64"; \ fi && \ curl -o \ /tmp/ntfy.tar.gz -L \ From 57fefcd35a855720d6d45f6fcdca770b612b76cb Mon Sep 17 00:00:00 2001 From: Rayvon Cadle Date: Fri, 26 Jan 2024 19:55:47 -0600 Subject: [PATCH 10/10] Update README.md --- README.md | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e011b82..950bfc4 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,43 @@ -# Docker Ntfy +![ntfy](https://github.com/binwiederhier/ntfy/raw/main/web/public/static/images/ntfy.png) -[Ntfy](https://ntfy.sh/) A free and open source notification service. +# ntfy.sh | Send push notifications to your phone or desktop via PUT/POST -This is a Ntfy Docker image built on top of linuxserver.io's `baseimage-alpine:3.18` image, but is not supported by linuxserver.io. +**[ntfy](https://ntfy.sh/)** (pronounced *"notify"*) is a simple HTTP-based pub-sub notification service. -## The official docker image can be found at https://hub.docker.com/r/binwiederhier/ntfy +This is an unofficial Docker image built using the [LinuxServer](https://www.linuxserver.io/) team's [Alpine base-image](https://github.com/linuxserver/docker-baseimage-alpine). + +## Notice +Although using both [binwiederhier's](https://github.com/binwiederhier) and [LinuxServer's](https://www.linuxserver.io/) respective works at its core, this image is not associated with — nor endorsed by — either developers in any way, shape, or form. It is simply a project for me to learn container architecture, which I chose to make public in the spirit of [FOSS](https://en.wikipedia.org/wiki/Free_and_open-source_software). All rights belong to their respective owners. + +The official ntfy Docker image can be found [here](https://hub.docker.com/r/binwiederhier/ntfy) and you can support its developer [here](https://github.com/sponsors/binwiederhier) and [here](https://en.liberapay.com/ntfy/), or contribute to its development [here](https://github.com/binwiederhier/ntfy). ## Usage +To use this image, simply run the following command: +```shell +docker run -p 8080:8080 ghcr.io/raycadle/ntfy:latest +``` +or +```shell +podman run -p 8080:8080 ghcr.io/raycadle/ntfy:latest +``` -This image must be built and ran with the docker/podman cli. +## Build +If you wish to build this image locally, you can do so by running the commands below. -### Docker CLI +### Clone Repo +```shell +git clone https://github.com/raycadle/docker-ntfy.git && cd docker-ntfy ``` -docker build -t ntfy:latest . && \ -docker create \ +### Build & Run +```shell +docker build --build-arg BUILD_DATE="$(date +%d/%m/%y)" --build-arg VERSION="$(date +%R:%S)" --tag ntfy:latest . && \ +docker run \ --name=ntfy \ -e PUID=1000 \ -e PGID=1000 \ - -e TZ=Europe/London \ + -e TZ=America/Belize \ -p 8080:8080 \ - -v path_to_data:/config \ + -v /path/to/data:/config \ --restart unless-stopped \ ntfy:latest ```