I have a private mirror of index.docker.io hosted in Harbor. The address of the mirror is harbor.example.com/docker-hub. I can successfully pull images through this mirror with the docker-cli and with containerd (configured in the hosts.toml).
to kaniko, kaniko completely ignores the original host (harbor.example.com) and tries to fetch images (here: convco/convco:0.5.0) from https://hub.docker.com instead.
DEBU[0000] registry-map remaps index.docker.io to harbor.example.com/hub.docker.com.
DEBU[0000] Copying file /work/docker/Dockerfile to /kaniko/Dockerfile
TRAC[0000] Adding /var/run to default ignore list
DEBU[0000] Skip resolving path /kaniko/Dockerfile
DEBU[0000] Skip resolving path /work/docker
DEBU[0000] Skip resolving path /cache
DEBU[0000] Skip resolving path
DEBU[0000] Skip resolving path
DEBU[0000] Skip resolving path
DEBU[0000] Skip resolving path
DEBU[0000] Built stage name to index map: map[]
DEBU[0000] Found extra base image stage convco/convco:0.5.0
INFO[0000] Retrieving image manifest convco/convco:0.5.0
INFO[0000] Retrieving image convco/convco:0.5.0 from mapped registry harbor.example.com
WARN[0001] Failed to retrieve image convco/convco:0.5.0 from remapped registry harbor.example.com: unable to complete operation after 0 attempts, last error: GET https://hub.docker.com/v2/: unexpected status code 404 Not Found: <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>404 : Docker</title>
This only happens when the context path for the new repository contains dots ., so hub-docker-com works fine and is correctly resolved to harbor.example.com/hub-docker-com but hub.docker.com does not.
This is also evident in the unit tests (remote_test.go) on the current head e328007bc1fa0d8c2eacf1918bebbabc923abafa:
Dear maintainers,
Actual behavior
I have a private mirror of
index.docker.io
hosted in Harbor. The address of the mirror isharbor.example.com/docker-hub
. I can successfully pull images through this mirror with the docker-cli and with containerd (configured in thehosts.toml
).When passing either
or
to
kaniko
, kaniko completely ignores the original host (harbor.example.com
) and tries to fetch images (here:convco/convco:0.5.0
) fromhttps://hub.docker.com
instead.This only happens when the context path for the new repository contains dots
.
, sohub-docker-com
works fine and is correctly resolved toharbor.example.com/hub-docker-com
buthub.docker.com
does not.This is also evident in the unit tests (
remote_test.go
) on the current heade328007bc1fa0d8c2eacf1918bebbabc923abafa
:Expected behavior
Registry Mirrors with dots
.
in their repository names get resolved correctly.Additional Information
Dockerfile
Kaniko Image
-gcr.io/kaniko-project/executor@sha256:c3109d5926a997b100c4343944e06c6b30a6804b2f9abe0994d3de6ef92b028e
I will did into the code and see if this can be fixed quickly but just in case this rings a bell, any help is appreciated :)
Best regards, Florian.
Triage Notes for the Maintainers
--cache
flag