Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: Provide multi-arch images #1158

Closed
nfbyte opened this issue Mar 27, 2021 · 7 comments
Closed

Docker: Provide multi-arch images #1158

nfbyte opened this issue Mar 27, 2021 · 7 comments
Assignees
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release

Comments

@nfbyte
Copy link

nfbyte commented Mar 27, 2021

Currently there are two separate PhotoPrism repositories on Docker Hub for amd64 and arm64 under different names (photoprism and photoprism-arm64). This sucks for me especially because I use both arm64 and amd64 systems and I can't match deployment configuration between them due to this.

See:

@lastzero
Copy link
Member

So you need to deploy the same docker-compose.yml file on two different servers using different architectures? What if you put common config values in an extra .env file?

See https://docs.docker.com/compose/environment-variables/

@lastzero lastzero added the technical-support Support request label Mar 28, 2021
@lastzero lastzero self-assigned this Mar 28, 2021
@nfbyte
Copy link
Author

nfbyte commented Mar 28, 2021

It's not really about me, I know there are various band-aids that I can apply (and I do) but that still doesn't change the fact that configuration will be architecture-specific for no good reason.

Most software (all that I've encountered so far) uses multi-arch images.

@lastzero
Copy link
Member

We have limited resources and it was easier for us to set it up like that. As it turns out, it didn't cause real issues to anyone so far - including you. That's great :)

We don't have time to change our infrastructure and docs on a daily basis. That's a good enough reason to do this later, when we have time & better funding. There's more than enough other items on our roadmap right now.

@kvalev
Copy link
Contributor

kvalev commented Mar 28, 2021

If you are willing to switch to GitHub actions, I have a PR which already enables multi-arch builds. However the performance takes a hit as it is roughly 50% slower than your drone CI worker.

Anyway, multi-arch images are usually just a cosmetic thing, as there a usually other configuration parameters, which are architecture-specific, so you cant get around of using docker-compose overrides.

@nfbyte
Copy link
Author

nfbyte commented Mar 29, 2021

That's a good enough reason to do this later, when we have time & better funding.

That sounds perfectly reasonable.

as there a usually other configuration parameters, which are architecture-specific

This has not been true in my experience.

@graciousgrey graciousgrey added enhancement Refactoring, improvement or maintenance task and removed technical-support Support request labels May 20, 2021
lastzero pushed a commit that referenced this issue Jun 2, 2021
* added docker build for arm64 development image
* multi-arch development image
* enabled multi arch build for production build
* moved go installation into shell script
* skip chromedriver installation for arm32 builds
@lastzero lastzero changed the title Docker Hub - multi-arch image Docker: Provide multi-arch images Jun 2, 2021
@lastzero lastzero added the please-test Ready for acceptance test label Jun 2, 2021
lastzero added a commit that referenced this issue Jun 2, 2021
lastzero added a commit that referenced this issue Jul 15, 2021
This commit contains a few improvements discussed in PR #1432
with the primary goal to reduce the Docker image size.
Go has been upgraded from v1.16.4 to v1.16.6 as well.
lastzero added a commit that referenced this issue Jul 15, 2021
Move scripts/install-qemu.sh from Makefile to .drone.yml
lastzero added a commit that referenced this issue Jul 15, 2021
Hopefully this fixes repeated multi-arch builds with qemu.
lastzero added a commit that referenced this issue Jul 16, 2021
Skip installing go-mod-outdated, go-wrk, and exif-read-tool to
improve build performance on ARMv7 as they are not needed for building.
@yscialom
Copy link

Testing on my Raspberry Pi model 4B 2GB RAM.

Overall I'm pleased with PhotoPrism and havn't met major bug yet. Here is my docker-compose.yml for reference. Hope it helps. Let me know if you'd like some specifics on my experience.

version: "2"
services:
  photoprism:
    image: photoprism/photoprism:preview
    container_name: photoprism
    restart: unless-stopped
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined
    environment:
      UID: 1001
      GID: 1001
      TZ: "Europe/Paris"
      PHOTOPRISM_HTTP_COMPRESSION: "none"            # Improves transfer speed and bandwidth utilization (none or gzip)
      PHOTOPRISM_WORKERS: 2                          # Limits the number of indexing workers to reduce system load
      PHOTOPRISM_DEBUG: "false"                      # Run in debug mode (shows additional log messages)
      PHOTOPRISM_PUBLIC: "true"                      # No authentication required (disables password protection)
      PHOTOPRISM_READONLY: "true"                    # Don't modify originals directory (reduced functionality)
      PHOTOPRISM_EXPERIMENTAL: "false"               # Enables experimental features
      PHOTOPRISM_DISABLE_WEBDAV: "true"              # Disables built-in WebDAV server
      PHOTOPRISM_DISABLE_SETTINGS: "true"            # Disables Settings in Web UI
      PHOTOPRISM_DISABLE_TENSORFLOW: "true"          # Disables using TensorFlow for image classification
      PHOTOPRISM_DARKTABLE_PRESETS: "true"           # Enables Darktable presets and disables concurrent RAW conversion
      PHOTOPRISM_DETECT_NSFW: "false"                # Flag photos as private that MAY be offensive
      PHOTOPRISM_DATABASE_DRIVER: "sqlite"           # SQLite is an embedded database that doesn't require a server
      PHOTOPRISM_SITE_URL: "https://portfolio.(redacted)/"  # Public PhotoPrism URL
      PHOTOPRISM_SITE_TITLE: "Portfolio"
      PHOTOPRISM_SITE_AUTHOR: "Yankel Scialom"
    volumes:
      - "/media/raid1/applications/photoprism/data/var/lib/photoprism:/var/lib/photoprism"
      - "/media/raid1/applications/nextcloud/data/yscialom/files/Portfolio:/photoprism/originals/Portfolio:ro"
      - "/media/raid1/applications/photoprism/data/storage:/photoprism/storage"
    networks:
      - proxy
    dns:
      - 172.18.0.5
    labels:
      - "traefik.docker.network=proxy"
      - "traefik.enable=true"
      - "traefik.http.middlewares.photoprism-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.photoprism-secure.entrypoints=https"
      - "traefik.http.routers.photoprism-secure.middlewares=authelia@docker"
      - "traefik.http.routers.photoprism-secure.rule=Host(`portfolio.(redacted)`)"
      - "traefik.http.routers.photoprism-secure.service=photoprism"
      - "traefik.http.routers.photoprism-secure.tls=true"
      - "traefik.http.routers.photoprism.entrypoints=http"
      - "traefik.http.routers.photoprism.middlewares=photoprism-https-redirect"
      - "traefik.http.routers.photoprism.rule=Host(`portfolio.(redacted)`)"
      - "traefik.http.services.photoprism.loadbalancer.server.port=2342"

networks:
  proxy:
    external:
      name: proxy

@lastzero
Copy link
Member

New multi-arch development base image available soon! Comes with Go 1.17. I've also improved related config files and build scripts to fix potential issues.

Developers must pull the latest image and rebuild their container(s): The database service has been renamed from photoprism-db to mariadb, to match our production examples. The default config values and Makefile may be incompatible otherwise.

docker-compose stop
docker-compose pull
docker-compose build
docker-compose up

lastzero added a commit that referenced this issue Aug 31, 2021
Now comes with Go 1.17 pre-installed. To match production
docker-compose.yml examples, the development database was
renamed from "photoprism-db" to "mariadb".
@graciousgrey graciousgrey added released Available in the stable release and removed please-test Ready for acceptance test labels Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

5 participants