From 0fb6636ead8cf3674791e56ae9ce96243118ff4c Mon Sep 17 00:00:00 2001 From: Kostiantyn <32730812+kkovaletp@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:42:37 +0200 Subject: [PATCH] Switch all images to the new registry (#1109) * Switch all images to the new registry * Update compose files * Update Readme * Fix several merge issues. --------- Co-authored-by: Konstantin Koval --- .github/workflows/build.yml | 46 ++++++++++--------- Dockerfile | 2 +- README.md | 46 +++++++++++++------ .../docker-compose.example.yml | 2 +- .../docker-compose.minimal.example.yml | 2 +- 5 files changed, 59 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a665056..7531189c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,10 @@ on: env: IS_PUSHING_IMAGES: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }} # IS_PUSHING_IMAGES: true # Switch on when pushing images with forked repos. - DOCKER_REGISTRY: ${{ (github.repository == 'photoview/photoview' && '') || 'ghcr.io/' }} + DOCKER_REGISTRY: ${{ github.repository != 'photoview/photoview' && 'ghcr.io/' || '' }} DOCKER_USERNAME: viktorstrate - DOCKER_IMAGE: ${{ (github.repository == 'photoview/photoview' && 'viktorstrate/photoview') || github.repository }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_IMAGE: ${{ github.repository }} PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 jobs: @@ -91,9 +91,9 @@ jobs: if: ${{ env.IS_PUSHING_IMAGES == 'true' }} uses: docker/login-action@v3 with: - registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' }} - username: ${{ ( env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor ) || env.DOCKER_USERNAME }} - password: ${{ ( env.DOCKER_REGISTRY == 'ghcr.io/' && github.token ) || env.DOCKER_PASSWORD }} + registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' || '' }} + username: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor || env.DOCKER_USERNAME }} + password: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.token || env.DOCKER_PASSWORD }} - name: Docker meta id: docker_meta @@ -114,17 +114,17 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 with: - context: . - sbom: true - provenance: mode=max - platforms: ${{ env.PLATFORMS }} - pull: true - push: ${{ env.IS_PUSHING_IMAGES }} - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} + context: . + sbom: true + provenance: mode=max + platforms: ${{ env.PLATFORMS }} + pull: true + push: ${{ env.IS_PUSHING_IMAGES }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} annotations: ${{ steps.docker_meta.outputs.annotations }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=gha + cache-to: type=gha,mode=max build-args: | NODE_ENV=production VERSION=${{ github.ref_name }} @@ -140,6 +140,7 @@ jobs: fail-fast: false matrix: tags: ${{ fromJson(needs.prepare.outputs.tags) }} + # Comment out when pushing images with forked repos. if: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }} steps: # Makes sure your .dockleignore file is available to the next step @@ -151,8 +152,9 @@ jobs: - name: Docker Login uses: docker/login-action@v3 with: - username: ${{ env.DOCKER_USERNAME }} - password: ${{ env.DOCKER_PASSWORD }} + registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' || '' }} + username: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor || env.DOCKER_USERNAME }} + password: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.token || env.DOCKER_PASSWORD }} - name: Run Dockle for '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}' id: dockle @@ -160,12 +162,12 @@ jobs: continue-on-error: true uses: erzz/dockle-action@v1 with: - image: '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}' - report-name: dockle-results-${{ matrix.tags.tag }} - report-format: sarif + image: '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}' + report-name: dockle-results-${{ matrix.tags.tag }} + report-format: sarif failure-threshold: fatal - exit-code: 1 - timeout: 5m + exit-code: 1 + timeout: 5m - name: Upload SARIF file if: ${{ steps.dockle.conclusion == 'success' }} diff --git a/Dockerfile b/Dockerfile index 16f28c53..177e2990 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,7 +64,7 @@ RUN chmod +x /app/scripts/*.sh \ && /app/scripts/install_build_dependencies.sh \ && /app/scripts/install_runtime_dependencies.sh -COPY --from=viktorstrate/dependencies /artifacts.tar.gz /dependencies/ +COPY --from=photoview/dependencies /artifacts.tar.gz /dependencies/ # Split values in `/env` # hadolint ignore=SC2046 RUN export $(cat /env) \ diff --git a/README.md b/README.md index f00a7832..8981d86b 100644 --- a/README.md +++ b/README.md @@ -17,25 +17,43 @@ When your media has been scanned, they show up on the website, organised in the > If you have questions regarding setup or development, feel free to join the Discord server https://discord.gg/jQ392948u9 +# ATTENTION to Docker users !!! + +We migrated to the new Docker registry and all new images for the `master` tag, as well as future releases are going to be published there instead of the previously used registry. Old images will be still accessible in the old registry , so if you want to use 1 of those old images, you need to revert back to the old registry. + +Please update your `docker-compose.yml` file to use the new registry for the `photoview` image, as shown in the corresponding example of the compose file: + ## Demo site Visit https://photos.qpqp.dk/ Username: **demo** + Password: **demo** ## Contents -- [Demo site](#demo-site) -- [Main features](#main-features) -- [Supported Platforms](#supported-platforms) -- [Why yet another self-hosted photo gallery](#why-yet-another-self-hosted-photo-gallery) -- [Getting started — Setup with Docker](#getting-started--setup-with-docker) -- [Advanced setup](#advanced-setup) -- [Contributing](#contributing) -- [Set up Docker development environment](#set-up-docker-development-environment) -- [Set up local development environment](#set-up-local-development-environment) -- [Sponsors](#sponsors) +- [ATTENTION to Docker users !!!](#attention-to-docker-users-) + - [Demo site](#demo-site) + - [Contents](#contents) + - [Main features](#main-features) + - [Supported platforms](#supported-platforms) + - [Why yet another self-hosted photo gallery](#why-yet-another-self-hosted-photo-gallery) + - [Getting started — Setup with Docker](#getting-started--setup-with-docker) + - [Initial Setup](#initial-setup) + - [Advanced setup](#advanced-setup) + - [Hardware Acceleration](#hardware-acceleration) + - [Contributing](#contributing) + - [Set up Docker development environment](#set-up-docker-development-environment) + - [Start API and UI server with Docker Compose](#start-api-and-ui-server-with-docker-compose) + - [Start API server with Docker](#start-api-server-with-docker) + - [Start UI server with Docker](#start-ui-server-with-docker) + - [Set up local development environment](#set-up-local-development-environment) + - [Install dependencies](#install-dependencies) + - [Local setup](#local-setup) + - [Start API server](#start-api-server) + - [Start UI server](#start-ui-server) + - [Sponsors](#sponsors) ## Main features @@ -171,10 +189,10 @@ If you verify other hardware accelerations working well, let us know. 🎉 First off, thanks for your interest in contribution! 🎉 -This project is a result of hard work, and it's great to see you interested in contributing. +This project is a result of hard work, and it's great to see you interested in contributing. Contributions are not just about code — you can help in many ways! -Before you start, please take a moment to read our [Contributing guide](./CONTRIBUTING.md). +Before you start, please take a moment to read our [Contributing guide](./CONTRIBUTING.md). It includes information on our code of conduct, the process for submitting pull requests, and more. Remember, every contribution counts. Let's make this project better together! 💪 @@ -254,10 +272,10 @@ We can't keep verifying below commands on each environment. People may need to s - `g++` - `libc-dev` - `libheif` >= 1.15.1 - - [go-face Requirements](https://github.com/Kagami/go-face#requirements) + - [go-face Requirements](https://github.com/Kagami/go-face#requirements) - `dlib` - `libjpeg` - - `libblas` + - `libblas` - `libcblas`, recommended using `libatlas-base` in Debian. - `liblapack` - Optional tools during developing: diff --git a/docker-compose example/docker-compose.example.yml b/docker-compose example/docker-compose.example.yml index a2b4de15..bdaf4880 100644 --- a/docker-compose example/docker-compose.example.yml +++ b/docker-compose example/docker-compose.example.yml @@ -1,6 +1,6 @@ services: photoview: - image: viktorstrate/photoview:2 + image: photoview/photoview:2 labels: - "com.centurylinklabs.watchtower.enable=true" hostname: photoview diff --git a/docker-compose example/docker-compose.minimal.example.yml b/docker-compose example/docker-compose.minimal.example.yml index 6b3d5e1e..8fa5ef90 100644 --- a/docker-compose example/docker-compose.minimal.example.yml +++ b/docker-compose example/docker-compose.minimal.example.yml @@ -1,6 +1,6 @@ services: photoview: - image: viktorstrate/photoview:2 + image: photoview/photoview:2 hostname: photoview container_name: photoview restart: unless-stopped