Skip to content

🐛 (go/v4) fix: revert accidental addition of explicit docker.io registry in Dockerfile #4818

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

Merged

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented May 24, 2025

✅ Why?

Docker already defaults to Docker Hub (docker.io) when no registry is specified.
So both forms are functionally the same, but:


  1. Keeps the scaffold clean and idiomatic
  • Most open source projects use the short form (golang:1.24).
  • It's easier to read and better for beginners.
  • This follows standard Go and Docker community practices.
  • Adding docker.io just adds noise to the file.

  1. Avoids lock-in or assumptions
  • Hardcoding docker.io can break things in environments with custom or mirrored registries.
  • It may confuse users who want to use private registries or CI configs.
  • By writing golang:1.24, we let the Docker config decide where to pull from — which is more flexible and future-proof.

TL;DR
golang:1.24 already pulls from Docker Hub.
Adding docker.io is not needed — and removing it keeps the Dockerfile clean, standard, and portable.
It was added by mistake in the PR: #4585

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 24, 2025
@@ -1,6 +1,6 @@
{
"name": "Kubebuilder DevContainer",
"image": "docker.io/golang:1.24",
"image": "golang:1.24",
Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @dongjiang1989

I am pinging you to make you aware.
It was my mistake since I did not review your PR.

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 24, 2025
@k8s-ci-robot k8s-ci-robot merged commit 14add27 into kubernetes-sigs:master May 24, 2025
33 of 34 checks passed
@camilamacedo86 camilamacedo86 deleted the fix-indiomatic-docker branch May 24, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants