Skip to content

Dockerfile: Add support of dockerHubMirror - #606

Draft
stanislav-zaprudskiy wants to merge 2 commits into
mainfrom
add_dockerhub_mirror_config
Draft

stanislav-zaprudskiy wants to merge 2 commits into
mainfrom
add_dockerhub_mirror_config

Conversation

@stanislav-zaprudskiy

@stanislav-zaprudskiy stanislav-zaprudskiy commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This could be useful overall (including when cfg.Metadata.IsSAPInternalProject() is true) in order to get around issues with default registries.

@stanislav-zaprudskiy
stanislav-zaprudskiy marked this pull request as ready for review August 12, 2026 15:37
@stanislav-zaprudskiy
stanislav-zaprudskiy requested a review from a team as a code owner August 12, 2026 15:37

@majewsky majewsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please explain the usecase where you have to set this manually. go-m-m already has way too many config parameters, so I am exercising extensive scrutiny for all additions.

@majewsky majewsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah sorry, I did not see your explanation in Slack.

Since this is only a temporary workaround, I reject the addition of a new config flag. Please hardcode the repository in question with a TODO marker to remove this once we have fixed the issue in Keppel.

@stanislav-zaprudskiy
stanislav-zaprudskiy force-pushed the add_dockerhub_mirror_config branch from 0a9aa5c to e50c5c8 Compare August 13, 2026 10:32

@stanislav-zaprudskiy stanislav-zaprudskiy left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread internal/core/config.go
var AutogeneratedHeader string

///////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry about this change, but this is a non-conformant comment. My linter keeps re-formatting it since forever whenever I work with the file, complicating further git add (that now requires -p).

if strings.HasPrefix(cfg.Metadata.URL, "https://github.wdf.sap.corp") {
var dockerHubMirror = cfg.Dockerfile.DockerHubMirror
if dockerHubMirror == "" && cfg.Metadata.IsSAPInternalProject() {
dockerHubMirror = "keppel.eu-de-1.cloud.sap/ccloud-dockerhub-mirror/library/"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm wary to change this value for everyone (other mirrors could have other issues I haven't yet discovered). How about keeping a undocumented temporary config entry in the meantime?

@stanislav-zaprudskiy
stanislav-zaprudskiy force-pushed the add_dockerhub_mirror_config branch 2 times, most recently from 03590f9 to fa52afe Compare August 13, 2026 10:47
@stanislav-zaprudskiy
stanislav-zaprudskiy force-pushed the add_dockerhub_mirror_config branch from fa52afe to d7c4af1 Compare August 13, 2026 10:50
@github-actions

Copy link
Copy Markdown
Contributor

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/go-makefile-maker/internal/core 2.63% (-0.04%) 👎
github.com/sapcc/go-makefile-maker/internal/dockerfile 0.00% (ø)
github.com/sapcc/go-makefile-maker/internal/hyperspace 0.00% (ø)
github.com/sapcc/go-makefile-maker/internal/renovate 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/go-makefile-maker/internal/core/config.go 3.12% (-0.05%) 128 (+2) 4 124 (+2) 👎
github.com/sapcc/go-makefile-maker/internal/dockerfile/docker.go 0.00% (ø) 0 0 0
github.com/sapcc/go-makefile-maker/internal/hyperspace/hyperspace.go 0.00% (ø) 0 0 0
github.com/sapcc/go-makefile-maker/internal/renovate/renovate.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@stanislav-zaprudskiy

Copy link
Copy Markdown
Contributor Author

Should be good now, would you have a look?

Comment thread internal/core/config.go
Comment on lines +320 to +324
// Deprecated: it's a temporary field that could go away w/ notice.
//
// TODO: remove when keppel issues with anonymous unauthenticated
// pulls are sorted out (ref: /archives/CE3JA3VSL/p1785758618816019)
DockerHubMirror string `yaml:"dockerHubMirror"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, please don't add this with a deprecation notice either. I still will have to hunt around tearing it out of the walls again in a few weeks. Please hardcode a match for the specific repo URLs where you need the different mirror.

@stanislav-zaprudskiy
stanislav-zaprudskiy marked this pull request as draft August 13, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants