From 9f0d8c16e2430340111fdc51010cad88cfdb6530 Mon Sep 17 00:00:00 2001 From: Timm Heuss Date: Fri, 21 Jun 2024 21:03:43 +0200 Subject: [PATCH 1/4] Using alpine images, they support multi-arch now --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b21c24..e60ec13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,13 @@ # Enriches third-party RSS feeds with full text articles # https://bitbucket.org/fivefilters/full-text-rss -FROM heussd/git as gitsrc +FROM alpine/git AS gitsrc WORKDIR /ftr RUN git clone https://bitbucket.org/fivefilters/full-text-rss.git . && \ git reset --hard 384d52fd83361ffd6e7f28bd39b322970a015a28 -FROM heussd/git as gitconfig +FROM alpine/git AS gitconfig WORKDIR /ftr-site-config RUN git clone https://github.com/fivefilters/ftr-site-config . From 7f396102961b1b241b1401730e156af49bcf8f41 Mon Sep 17 00:00:00 2001 From: Timm Heuss Date: Fri, 21 Jun 2024 21:04:10 +0200 Subject: [PATCH 2/4] Build with bake --- .github/workflows/build-and-push.yml | 67 +++++++++++++++------------- docker-bake.hcl | 17 +++++++ docker-compose.override.yml | 3 -- 3 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 docker-bake.hcl delete mode 100644 docker-compose.override.yml diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index c86b68f..8275309 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -1,40 +1,45 @@ name: Docker build and push on: - push: - branches: - - master - paths-ignore: - - '**.md' - - 'docker-compose.yml' - schedule: - - cron: '0 13 * * 0' - + push: + branches: + - master + paths-ignore: + - '**.md' + schedule: + - cron: '0 13 * * 0' jobs: - build: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest + + steps: + - name: checkout code + uses: actions/checkout@v2 - steps: - - name: checkout code - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: all + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: all - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - version: latest + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest - - name: Login to docker hub - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + - name: Login to docker hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: build the image - run: | - docker buildx build --push \ - --tag heussd/fivefilters-full-text-rss:latest \ - --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 . + - name: build the amd64 image + run: | + docker buildx bake amd64 --load + - name: test amd64 image + run: | + docker compose up --no-build --pull never -d + curl --fail 'http://localhost:80' + curl --fail 'http://localhost/makefulltextfeed.php?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml&max=1&links=preserve' + docker compose down + - name: build and push all images + run: | + docker buildx bake --push diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000..f101b43 --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,17 @@ +variable "IMAGE" { + default = "heussd/fivefilters-full-text-rss:latest" +} + +group "default" { + targets = ["all"] +} + +target "all" { + tags = ["${IMAGE}"] + platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/arm/v6"] +} + +target "amd64" { + tags = ["${IMAGE}"] + platforms = ["linux/amd64"] +} diff --git a/docker-compose.override.yml b/docker-compose.override.yml deleted file mode 100644 index 561e566..0000000 --- a/docker-compose.override.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - fullfeedrss: - build: . From 35c9fd202c70f25553915b1bbd287455acda9e93 Mon Sep 17 00:00:00 2001 From: Timm Heuss Date: Fri, 21 Jun 2024 21:04:23 +0200 Subject: [PATCH 3/4] Latest naming convention for compose --- Readme.md | 33 +++++++++++++++---------------- docker-compose.yml => compose.yml | 0 2 files changed, 16 insertions(+), 17 deletions(-) rename docker-compose.yml => compose.yml (100%) diff --git a/Readme.md b/Readme.md index 1604224..4b291fb 100644 --- a/Readme.md +++ b/Readme.md @@ -8,31 +8,30 @@ This is a containerized version of [fivefilters full-text-rss](https://www.fivef Not affiliated with [fivefilters.org](http://fivefilters.org/). The Dockerfile is licensed under [MIT conditions](LICENSE). - ## User Guide -- Use the following [docker-compose.yml](docker-compose.yml) +- Use the following [compose.yml](compose.yml) ```yaml services: - fullfeedrss: - image: "heussd/fivefilters-full-text-rss:latest" - environment: - # Leave empty to disable admin section - - FTR_ADMIN_PASSWORD= - volumes: - - "rss-cache:/var/www/html/cache/rss" - ports: - - "80:80" + fullfeedrss: + image: 'heussd/fivefilters-full-text-rss:latest' + environment: + # Leave empty to disable admin section + - FTR_ADMIN_PASSWORD= + volumes: + - 'rss-cache:/var/www/html/cache/rss' + ports: + - '80:80' volumes: - rss-cache: + rss-cache: ``` -- Start it with `docker-compose up` -- Visit [http://localhost:80](http://localhost:80) for the integrated web UI +- Start it with `docker-compose up` +- Visit [http://localhost:80](http://localhost:80) for the integrated web UI ![](webui.png) -- Interesting endpoints (see tab [Request & Response](http://localhost/#request)): - - Article extraction: `http://localhost/extract.php?url=[url]` - - Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]` +- Interesting endpoints (see tab [Request & Response](http://localhost/#request)): + - Article extraction: `http://localhost/extract.php?url=[url]` + - Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]` diff --git a/docker-compose.yml b/compose.yml similarity index 100% rename from docker-compose.yml rename to compose.yml From c95dcb1e9e86b4a899b5f18b657afcba65f2c15a Mon Sep 17 00:00:00 2001 From: Timm Heuss Date: Fri, 21 Jun 2024 21:05:14 +0200 Subject: [PATCH 4/4] Wait for container to start, restructuring --- .github/workflows/build-and-push.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 8275309..722ace1 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -1,9 +1,7 @@ -name: Docker build and push +name: Build, test and push Docker images on: push: - branches: - - master paths-ignore: - '**.md' schedule: @@ -12,9 +10,8 @@ on: jobs: build: runs-on: ubuntu-latest - steps: - - name: checkout code + - name: Checkout code uses: actions/checkout@v2 - name: Set up QEMU @@ -31,15 +28,20 @@ jobs: - name: Login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: build the amd64 image + - name: Build amd64 image run: | docker buildx bake amd64 --load - - name: test amd64 image + - name: Test amd64 image run: | docker compose up --no-build --pull never -d + sleep 5s curl --fail 'http://localhost:80' - curl --fail 'http://localhost/makefulltextfeed.php?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml&max=1&links=preserve' + curl --fail 'http://localhost:80/makefulltextfeed.php?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml&max=1&links=preserve' docker compose down - - name: build and push all images + - name: Build all images + run: | + docker buildx bake + - name: Release images to Dockerhub + if: github.ref == 'refs/heads/master' run: | docker buildx bake --push