docker: provide default container names#12962
docker: provide default container names#12962dominic-r wants to merge 1 commit intogoauthentik:mainfrom
Conversation
Signed-off-by: Dominic R <dominic@sdko.org>
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
I presume, if this is accepted, I'll also have to add it to the 2025.x.md/next.md/whatever it was next-release release notes? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12962 +/- ##
==========================================
- Coverage 92.75% 92.69% -0.07%
==========================================
Files 785 785
Lines 39580 39580
==========================================
- Hits 36714 36689 -25
- Misses 2866 2891 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
While I'm not necessarily against this change, this might (?) be a breaking change. I'm not sure overriding the way docker-compose manages container names is something we want to do. What were the specific reasons for this change? |
Won't really be a breaking change. Users will rebuild containers and use the --remove-orphans option to remove old containers. Everything else should work just fine. As for specific reasons, there's nothing that can't be done if container_name is not set. It's often shorter than the name Docker provides, easier for quick |
That's exactly where the break happens. For one thing, users with automated deploy processes (even though I highly doubt they just download the docker-compose in that case) might not remove orphan containers by default. Also, we don't include that option in our upgrading docs. |
|
Considering what you mentioned and the false motivation related to the backup PR, what do you suggest doing with this one? Closing it? |
|
Yeah I don't think we need/want this change for now |
What?
This PR adds default container names to the Postgres database, Redis, server, and worker.
The majority of Docker Compose files (for authentik and other services out there in the internet) already hard-code container names, so this change aligns with common best practices.
By setting explicit names, we allow users to reference containers directly with commands like:
docker exec -it authentik-worker akinstead of relying on
docker compose [...], which fails withif the user is not in the directory containing the Compose file.
This improves the experience of the user (and mine too as I need to reference these containers in some doc pages) when following documentation steps and makes the output of
docker psless of a mess.Details
REPLACE ME
Checklist
ak test authentik/)make lint-fix)If an API change has been made
make gen-build)If changes to the frontend have been made
make web)If applicable
make website)