readme: add --registry-mirror

Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
Yoan Blanc 2019-11-10 12:55:31 +01:00
parent 73f7ea0d2c
commit 6e2287c969
No known key found for this signature in database
GPG Key ID: 6058CF4574298812
3 changed files with 7 additions and 2 deletions

View File

@ -46,6 +46,7 @@ _If you are interested in contributing to kaniko, see [DEVELOPMENT.md](DEVELOPME
- [--insecure-pull](#--insecure-pull)
- [--no-push](#--no-push)
- [--oci-layout-path](#--oci-layout-path)
- [--registry-mirror](#--registry-mirror)
- [--reproducible](#--reproducible)
- [--single-snapshot](#--single-snapshot)
- [--snapshotMode](#--snapshotmode)
@ -441,6 +442,10 @@ Set this flag if you want to pull images from a plain HTTP registry. It is suppo
Set this flag if you only want to build the image, without pushing to a registry.
#### --registry-mirror
Set this flag if you want to use a registry mirror instead of default `index.docker.io`.
#### --reproducible
Set this flag to strip timestamps out of the built image and make it reproducible.

View File

@ -171,7 +171,7 @@ func TestMain(m *testing.M) {
},
{
name: "Building kaniko image using registry-mirror",
command: []string{"docker", "build", "--registry-mirror", "https://mirror.gcr.io", "-t", ExecutorImage, "-f", "../deploy/Dockerfile", ".."},
command: []string{"docker", "build", "--registry-mirror", "mirror.gcr.io", "-t", ExecutorImage, "-f", "../deploy/Dockerfile", ".."},
},
}

View File

@ -102,7 +102,7 @@ func Test_ScratchImageFromMirror(t *testing.T) {
actual, err := RetrieveSourceImage(config.KanikoStage{
Stage: stages[1],
}, &config.KanikoOptions{
RegistryMirror: "https://mirror.gcr.io",
RegistryMirror: "mirror.gcr.io",
})
expected := empty.Image
testutil.CheckErrorAndDeepEqual(t, false, err, expected, actual)