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

Use of FQIN in Dockerfile FROM instructions. #23954

Closed
gitouche-sur-osm opened this issue Apr 6, 2023 · 1 comment · Fixed by #23955
Closed

Use of FQIN in Dockerfile FROM instructions. #23954

gitouche-sur-osm opened this issue Apr 6, 2023 · 1 comment · Fixed by #23955
Labels
good first issue Likely to be an easy fix type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@gitouche-sur-osm
Copy link

Feature Description

This is a request for the use of Fully Qualified Image Names (FQIN) in Dockerfile FROM instructions.
eg. FROM alpine:3.17 -> FROM docker.io/library/alpine:3.17

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 HUB might not be the default registry), while staying 100% docker compatible.

Lines that would need patching :

FROM golang:1.20-alpine3.17 AS build-env

FROM alpine:3.17

FROM golang:1.20-alpine3.17 AS build-env

FROM alpine:3.17

Thank you for considering this request.

Screenshots

No response

@gitouche-sur-osm gitouche-sur-osm added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Apr 6, 2023
@techknowlogick techknowlogick added the good first issue Likely to be an easy fix label Apr 6, 2023
@techknowlogick
Copy link
Member

@gitouche-sur-osm thanks for the suggestion. I've just created a PR for this: #23955

techknowlogick added a commit that referenced this issue Apr 7, 2023
Fix #23954

This allows for building on platforms that don't have docker hub as the
default container registry.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Apr 7, 2023
Fix go-gitea#23954

This allows for building on platforms that don't have docker hub as the
default container registry.
6543 pushed a commit that referenced this issue Apr 7, 2023
Backport #23955 by @techknowlogick

Fix #23954

This allows for building on platforms that don't have docker hub as the
default container registry.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Likely to be an easy fix type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants