hedgedoc / container

HedgeDoc container image resources
https://docs.hedgedoc.org/setup/docker/
196 stars 52 forks source link

Use of FQIN in Dockerfile FROM instructions #422

Closed gitouche-sur-osm closed 1 year ago

gitouche-sur-osm commented 1 year ago

This is a request for the use of Fully Qualified Image Names (FQIN) in Dockerfile FROM instructions. e.g. FROM node:16.20.0-bullseye-slim -> FROM docker.io/library/node:16.20.0-bullseye-slim

The 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 :

echo $(docker info | grep -oP "(?<=Registry: ).*")
https://index.docker.io/v1/

But this behaviour might be different if registry-mirrors is set in docker daemon.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.

Lines that would need patching : https://github.com/hedgedoc/container/blob/27f5a9eabdf2d073b88dc55092b4bd08907a4c93/alpine/Dockerfile#L1 https://github.com/hedgedoc/container/blob/27f5a9eabdf2d073b88dc55092b4bd08907a4c93/alpine/Dockerfile#L31 https://github.com/hedgedoc/container/blob/27f5a9eabdf2d073b88dc55092b4bd08907a4c93/alpine/Dockerfile#L46 https://github.com/hedgedoc/container/blob/27f5a9eabdf2d073b88dc55092b4bd08907a4c93/debian/Dockerfile#L1 https://github.com/hedgedoc/container/blob/27f5a9eabdf2d073b88dc55092b4bd08907a4c93/debian/Dockerfile#L33 https://github.com/hedgedoc/container/blob/27f5a9eabdf2d073b88dc55092b4bd08907a4c93/debian/Dockerfile#L49

Thank you for considering this request.

Avi98 commented 1 year ago

@ErikMichelson can i take this up.

ErikMichelson commented 1 year ago

Sure 👍