Skip to content

Example for deploying with traefik in swarm mode #419

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

agahkarakuzu
Copy link

Hi there!

I came across #380 and decided to add this example, which I can confirm works with the following versions on Ubuntu 24.04:

Client: Docker Engine - Community
 Version:           26.0.0
 API version:       1.45
 Go version:        go1.21.8
 Git commit:        2ae903e
 Built:             Wed Mar 20 15:17:48 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:17:48 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

It is important to deal with CORS and passing auth headers using traefik labels rather than using ENV vars to ensure that all the fields are populated:

image

Otherwise, you'll run into 401 errors and some details like creation date, size, architecture may not be loaded (calls to OPTIONS),

@agahkarakuzu
Copy link
Author

And I noticed #396 after doing so :) Then again, not identical deployments, still can make a useful resource.

@jnovack
Copy link

jnovack commented Apr 22, 2025

It is important to deal with CORS and passing auth headers using traefik labels rather than using ENV vars to ensure that all the fields are populated

Can you detail the steps you took to do this for documentation purposes?

Nevermind, I'm a moron.

@agahkarakuzu
Copy link
Author

No at all :) Thanks for your feedback!

Regarding the Redis memory allocation, I’m happy to reduce the limit to 1–2 GB. The higher limit was initially set because some of the Docker image layers we’re working with were humongous.

Copy link

@jnovack jnovack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not part of the project, just an independent reviewer.

services:

traefik:
image: traefik:v2.11.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v3 has been stable for over a year, please use a stable v3 version.

command:
# - --log.level=DEBUG
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In traefik v3, the docker provider has been deprecated for swarm. Please update all references as appropriate.

Copy link
Author

@agahkarakuzu agahkarakuzu Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnovack I'll make ensure a proper v2 --> v3 migration and will let you know when done.

@jnovack
Copy link

jnovack commented Apr 22, 2025

The higher limit was initially set because some of the Docker image layers we’re working with were humongous.

How does that affect redis? The image layers aren't stored in redis?

...we’re working with...

Yes, but these are templates for general purpose use, for people to learn from and apply in their own environments. They should be as "generic" as possible while still showing off the fancy tips and tricks that you did to make it work.

@agahkarakuzu
Copy link
Author

Yes, but these are templates for general purpose use, for people to learn from and apply in their own environments.

I totally agree, the limits were indeed leftover. I'll push the changes you requested.

- Reduce redis memory allocation
- Remove version tag
@jnovack
Copy link

jnovack commented Apr 23, 2025

Not sure I like the directory traefik-new. Maybe something more descriptive? traefik-swarm seems to be more descriptive?

@jnovack
Copy link

jnovack commented Apr 23, 2025

I just went ahead to submitted a PR for your PR (yo dawg, I heard you liked PRs).

I believe this is a cleaner baseline to start with and near complete.

jnovack added a commit to jnovack/docker-registry-ui that referenced this pull request Apr 23, 2025
@agahkarakuzu
Copy link
Author

Well, thanks for your effort, "dawg".

I'll let the maintainers weigh in on #423. I’m just not sure if the code of conduct at https://github.com/Joxit/docker-registry-ui/blob/main/CODE_OF_CONDUCT.md include steamrolling other's commits and tossing everyone else’s work into the README as ✨consolation✨.

There are alternatives to overriding, like opening a PR to my fork. But I guess that’s not dawgie vibes.

jnovack added a commit to jnovack/docker-registry-ui that referenced this pull request Apr 24, 2025
@jnovack
Copy link

jnovack commented Apr 24, 2025

I tried that, but I rewrote nearly every file of yours (the redis one was untouched) and completely scrapped your readme. I differed in the way I organized and structured my data and completely rewrote the labels for v3.

I loved the way you did your comments, so I used them. It was a good idea. That's hardly "stealing".

I'm not here to cause beef, I respect and appreciated your hard work. I felt it was more of an insult to submit a PR to your repo and completely delete your files and your work. But if that's what you want, I will oblige. PR incoming!

jnovack added a commit to jnovack/docker-registry-ui that referenced this pull request Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants