mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-07 21:15:39 -05:00
[GH-ISSUE #3493] Use of FQIN in Dockerfile FROM instructions #10398
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gitouche-sur-osm on GitHub (May 1, 2023).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/3493
Subject of the issue
This is a request for the use of
Fully Qualified Image Names (FQIN)in DockerfileFROMinstructions.e.g.
FROM alpine->FROM docker.io/library/alpineThe use of short names is ambiguous as the registry it pulls from might depend on docker (or alternative build system) configuration. This is better explained in containers-registries.conf man page.
Docker uses hardcoded configuration in order to search for short names on docker.io registry :
But this behaviour might be different if
registry-mirrorsis set in dockerdaemon.json.This would also improve support for docker alternatives as well (e.g. buildah, where the docker.io registry might not be the default registry), while staying 100% docker compatible.
File that needs changes :
docker/Dockerfile.j2See the changes in my fork : https://github.com/dani-garcia/vaultwarden/compare/main...gitouche-sur-osm:vaultwarden:main#diff-4331345734d1b2a2578682b272eae8952289a0cffb0b5b6dd118f40802a4d055
Would you consider a PR for this?
Thank you for considering this request.
@BlackDex commented on GitHub (May 1, 2023):
Well, what if someone wants to use a different registry as it's default? Then they need to either configure that it overrules there config? Or modify the Dockerfile?
Im not sure this would be a good change. But i haven't looked at it that well
@gitouche-sur-osm commented on GitHub (May 2, 2023):
Thank you for taking the time to review this.
I have some corporate docker configuration where docker.io is not the default registry (corporate registry is used instead), and short names in Dockerfile cannot be computed correctly. It needs to know "alpine" is in fact at "docker.io/library/alpine", the only way to do that is to explicity use the fully qualified image name.
This makes building the image both safer (better explained in containers-registries.conf man page ) and more reliable, as it will work regardless of the local docker registry configuration.
PS : this is not about the registry where the image is pushed once built.
@BlackDex commented on GitHub (May 2, 2023):
That seems logical. Thanks for the extra information and bringing this to our attention.
@BlackDex commented on GitHub (May 3, 2023):
@gitouche-sur-osm If you rebase your changes on the current main, and create a PR, I'm going to approve that.
@BlackDex commented on GitHub (May 8, 2023):
Resolved via #3505