From 737e4fcb0fecbaedfe64762cbc2b7d2ce6df945f Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Fri, 22 Apr 2022 17:11:08 +0200 Subject: [PATCH 01/10] push to newest beta version [skip ci] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e42dab8..260b19c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.15 AS builder -ENV VERSION=11.0.0-SNAPSHOT.20220213174344 +ENV VERSION=11.0.0-SNAPSHOT.20220418221611 RUN apk add --no-cache \ openjdk17-jdk \ maven \ From dff72fdea7a016c2c8deffb572c0facd4fe3bd38 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sat, 2 Jul 2022 18:32:23 +0200 Subject: [PATCH 02/10] push to version 11.0.0-SNAPSHOT.20220625052932 --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 260b19c..8f41896 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM alpine:3.15 AS builder +FROM docker.io/alpine:3.15 AS builder -ENV VERSION=11.0.0-SNAPSHOT.20220418221611 +ENV VERSION=11.0.0-SNAPSHOT.20220625052932 RUN apk add --no-cache \ openjdk17-jdk \ maven \ @@ -13,7 +13,7 @@ RUN git checkout "$VERSION" RUN mvn package -FROM thallian/alpine-s6:latest +FROM docker.io/thallian/alpine-s6:latest ENV JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ENV AIRSONIC_DIR=/home/airsonic From 164efe9d2d2d25f36204da33b0438a037ec53576 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 12 Jul 2022 18:45:26 +0200 Subject: [PATCH 03/10] use newer base image --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f41896..db25c1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/alpine:3.15 AS builder +FROM docker.io/alpine:3.16 AS builder ENV VERSION=11.0.0-SNAPSHOT.20220625052932 RUN apk add --no-cache \ @@ -13,7 +13,7 @@ RUN git checkout "$VERSION" RUN mvn package -FROM docker.io/thallian/alpine-s6:latest +FROM docker.io/thallian/alpine-s6:3.16 ENV JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ENV AIRSONIC_DIR=/home/airsonic From c0c5419afcd1ab2b44d9a1a40ee212a58bd8d21c Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 12 Jul 2022 19:05:11 +0200 Subject: [PATCH 04/10] Do not run tests. They make trouble in a kaniko environment and as this container is about to be retired anyways it is not too important. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index db25c1e..35b971b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN git clone https://github.com/airsonic-advanced/airsonic-advanced WORKDIR /airsonic-advanced RUN git checkout "$VERSION" -RUN mvn package +RUN mvn package -DskipTests FROM docker.io/thallian/alpine-s6:3.16 From 55837f313fdb2f291d132e068898bc40a64d36d5 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Fri, 11 Nov 2022 06:49:47 +0000 Subject: [PATCH 05/10] Delete '.gitlab-ci.yml' --- .gitlab-ci.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index a477804..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -variables: - CONTAINER_NAME: thallian/airsonic - -build: - stage: build - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [""] - script: - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json - - >- - /kaniko/executor - --cache=false - --context "$CI_PROJECT_DIR" - --dockerfile "$CI_PROJECT_DIR/Dockerfile" - --destination "$CONTAINER_NAME:$CI_COMMIT_SHA" - --destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME" - --destination "$CONTAINER_NAME:latest" From d94db7184c250747f8690fff6f6298a5867823b3 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Fri, 11 Nov 2022 06:50:38 +0000 Subject: [PATCH 06/10] Add '.woodpecker.yml' --- .woodpecker.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..a9e1e9d --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,11 @@ +pipeline: + publish-docker-image: + image: plugins/kaniko + settings: + repo: docker.io/thallian/airsonic + tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG=pre} + dockerfile: Dockerfile + username: + from_secret: DOCKER_USER + password: + from_secret: DOCKER_PW \ No newline at end of file From 61ed1617d816f4303c39376eabf64528dfbb223d Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sun, 5 Mar 2023 11:55:41 +0100 Subject: [PATCH 07/10] use postgres as backend --- Dockerfile | 18 +++++++++--------- README.md | 14 ++++++++++++++ .../etc/confd/conf.d/airsonic.properties.toml | 6 ++++++ .../confd/templates/airsonic.properties.tmpl | 6 ++++++ .../s6-overlay/s6-rc.d/airsonic/dependencies | 1 + 5 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 rootfs/etc/confd/conf.d/airsonic.properties.toml create mode 100644 rootfs/etc/confd/templates/airsonic.properties.tmpl create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/airsonic/dependencies diff --git a/Dockerfile b/Dockerfile index 35b971b..676b83d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM docker.io/alpine:3.16 AS builder +FROM docker.io/alpine:3.17 AS builder -ENV VERSION=11.0.0-SNAPSHOT.20220625052932 +ENV VERSION=11.0.0-SNAPSHOT.20230217142243 RUN apk add --no-cache \ openjdk17-jdk \ maven \ @@ -13,18 +13,18 @@ RUN git checkout "$VERSION" RUN mvn package -DskipTests -FROM docker.io/thallian/alpine-s6:3.16 +FROM docker.io/thallian/confd-env:3.17-3.1.3.0 ENV JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ENV AIRSONIC_DIR=/home/airsonic RUN apk add --no-cache \ - ca-certificates \ - openssl \ - ffmpeg \ - flac \ - opus \ - lame \ + ca-certificates \ + openssl \ + ffmpeg \ + flac \ + opus \ + lame \ openjdk17-jre-headless RUN addgroup -g 2222 airsonic diff --git a/README.md b/README.md index 0d77f86..6e3e76b 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,19 @@ - `/home/airsonic/playlists` - `/home/airsonic/podcasts` +# Environment Variables +## DB_URL + +JDBC url for the postgres conection. + +## DB_USER +- default: airsonic + +Username with which to connect to the database. + +## DB_PASSWORD + +Password for the databse connection. + # Ports - 8080 diff --git a/rootfs/etc/confd/conf.d/airsonic.properties.toml b/rootfs/etc/confd/conf.d/airsonic.properties.toml new file mode 100644 index 0000000..6f6084a --- /dev/null +++ b/rootfs/etc/confd/conf.d/airsonic.properties.toml @@ -0,0 +1,6 @@ +[template] +src = "airsonic.properties.tmpl" +dest = "/home/airsonic/data/airsonic.properties" +gid = 2222 +uid = 2222 +mode = "0660" diff --git a/rootfs/etc/confd/templates/airsonic.properties.tmpl b/rootfs/etc/confd/templates/airsonic.properties.tmpl new file mode 100644 index 0000000..1b785c5 --- /dev/null +++ b/rootfs/etc/confd/templates/airsonic.properties.tmpl @@ -0,0 +1,6 @@ +spring.datasource.driver-class-name=org.postgresql.Driver +spring.datasource.url={{ getenv "DB_URL" }} +spring.datasource.username={{ getenv "DB_USER" "airsonic" }} +spring.datasource.password={{ getenv "DB_PASSWORD" }} +spring.liquibase.parameters.userTableQuote=" +server.forward-headers-strategy=native diff --git a/rootfs/etc/s6-overlay/s6-rc.d/airsonic/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/airsonic/dependencies new file mode 100644 index 0000000..7ba7514 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/airsonic/dependencies @@ -0,0 +1 @@ +confd From a977e369b8b583deb1a7604cc840fcec0dc5a429 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 26 Sep 2023 16:15:56 +0200 Subject: [PATCH 08/10] push to 11.0.0-SNAPSHOT.20230217142243 --- Dockerfile | 16 +++++++++------- mvn.patch | 8 ++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 mvn.patch diff --git a/Dockerfile b/Dockerfile index 676b83d..917b0d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,21 @@ -FROM docker.io/alpine:3.17 AS builder +FROM docker.io/alpine:3.18 AS builder -ENV VERSION=11.0.0-SNAPSHOT.20230217142243 +ENV VERSION=11.0.0-SNAPSHOT.20230217142243 RUN apk add --no-cache \ - openjdk17-jdk \ - maven \ - git + openjdk17-jdk \ + maven \ + git RUN git clone https://github.com/airsonic-advanced/airsonic-advanced WORKDIR /airsonic-advanced +COPY mvn.patch . RUN git checkout "$VERSION" +RUN git apply mvn.patch RUN mvn package -DskipTests -FROM docker.io/thallian/confd-env:3.17-3.1.3.0 +FROM docker.io/thallian/confd-env:3.18-3.1.5.0 ENV JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ENV AIRSONIC_DIR=/home/airsonic @@ -25,7 +27,7 @@ RUN apk add --no-cache \ flac \ opus \ lame \ - openjdk17-jre-headless + openjdk17-jre-headless RUN addgroup -g 2222 airsonic RUN adduser -h "$AIRSONIC_DIR" -S -D -u 2222 -G airsonic airsonic diff --git a/mvn.patch b/mvn.patch new file mode 100644 index 0000000..35fda35 --- /dev/null +++ b/mvn.patch @@ -0,0 +1,8 @@ +diff --git a/.mvn/maven.config b/.mvn/maven.config +index 7bd692d7..89f6445d 100644 +--- a/.mvn/maven.config ++++ b/.mvn/maven.config +@@ -1 +1,2 @@ +---settings ./.mvn/settings.xml ++--settings ++./.mvn/settings.xml From 70ed098d4a7a811bc153331020de06f6b420533f Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Thu, 14 Dec 2023 11:24:16 +0100 Subject: [PATCH 09/10] use gitea actions --- .gitea/workflows/container.yaml | 12 ++++++++++++ .woodpecker.yml | 11 ----------- Dockerfile => Containerfile | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 .gitea/workflows/container.yaml delete mode 100644 .woodpecker.yml rename Dockerfile => Containerfile (92%) diff --git a/.gitea/workflows/container.yaml b/.gitea/workflows/container.yaml new file mode 100644 index 0000000..e48b3fd --- /dev/null +++ b/.gitea/workflows/container.yaml @@ -0,0 +1,12 @@ +name: Build Multiarch Container Image +on: [push] +jobs: + call-reusable-workflow: + uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main + with: + repository: ${{ gitea.repository }} + ref_name: ${{ gitea.ref_name }} + sha: ${{ gitea.sha }} + registry_url: ${{ secrets.REGISTRY_URL }} + registry_user: ${{ secrets.REGISTRY_USER }} + registry_pw: ${{ secrets.REGISTRY_PW }} diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index a9e1e9d..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,11 +0,0 @@ -pipeline: - publish-docker-image: - image: plugins/kaniko - settings: - repo: docker.io/thallian/airsonic - tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG=pre} - dockerfile: Dockerfile - username: - from_secret: DOCKER_USER - password: - from_secret: DOCKER_PW \ No newline at end of file diff --git a/Dockerfile b/Containerfile similarity index 92% rename from Dockerfile rename to Containerfile index 917b0d8..3b16c78 100644 --- a/Dockerfile +++ b/Containerfile @@ -1,4 +1,4 @@ -FROM docker.io/alpine:3.18 AS builder +FROM docker.io/alpine:3.19 AS builder ENV VERSION=11.0.0-SNAPSHOT.20230217142243 RUN apk add --no-cache \ @@ -15,7 +15,7 @@ RUN git apply mvn.patch RUN mvn package -DskipTests -FROM docker.io/thallian/confd-env:3.18-3.1.5.0 +FROM docker.io/thallian/confd-env:3.19-3.1.6.2 ENV JAVA_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 ENV AIRSONIC_DIR=/home/airsonic From 21b4d10829dec5aba16b2389081f6fd53ae8828c Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Thu, 14 Dec 2023 11:34:26 +0100 Subject: [PATCH 10/10] use java 21 --- Containerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Containerfile b/Containerfile index 3b16c78..231e31f 100644 --- a/Containerfile +++ b/Containerfile @@ -2,7 +2,7 @@ FROM docker.io/alpine:3.19 AS builder ENV VERSION=11.0.0-SNAPSHOT.20230217142243 RUN apk add --no-cache \ - openjdk17-jdk \ + openjdk21-jdk \ maven \ git @@ -27,7 +27,7 @@ RUN apk add --no-cache \ flac \ opus \ lame \ - openjdk17-jre-headless + openjdk21-jre-headless RUN addgroup -g 2222 airsonic RUN adduser -h "$AIRSONIC_DIR" -S -D -u 2222 -G airsonic airsonic