You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
will try `docker-io.mirrors.corp.net` then `mirror.gcr.io` for `index.docker.io` and `127.0.0.1` for `gcr.io`
1010
+
will try `docker-io.mirrors.corp.net` then `mirror.gcr.io` for
1011
+
`index.docker.io` and `127.0.0.1` for `gcr.io`
1005
1012
1006
1013
#### Flag `--registry-mirror`
1007
1014
@@ -1010,7 +1017,8 @@ Set this flag if you want to use a registry mirror instead of the default
1010
1017
multiple mirrors. If an image is not found on the first mirror, Kaniko will try
1011
1018
the next mirror(s), and at the end fallback on the default registry.
1012
1019
1013
-
Mirror can also be defined through `KANIKO_REGISTRY_MIRROR` environment variable.
1020
+
Mirror can also be defined through `KANIKO_REGISTRY_MIRROR` environment
1021
+
variable.
1014
1022
1015
1023
Expected format is `mirror.gcr.io` for example.
1016
1024
@@ -1024,9 +1032,13 @@ are:
1024
1032
1025
1033
#### Flag `--skip-default-registry-fallback`
1026
1034
1027
-
Set this flag if you want the build process to fail if none of the mirrors listed in flag [registry-mirror](#flag---registry-mirror) can pull some image. This should be used with mirrors that implements a whitelist or some image restrictions.
1035
+
Set this flag if you want the build process to fail if none of the mirrors
1036
+
listed in flag [registry-mirror](#flag---registry-mirror) can pull some image.
1037
+
This should be used with mirrors that implements a whitelist or some image
1038
+
restrictions.
1028
1039
1029
-
If [registry-mirror](#flag---registry-mirror) is not set or is empty, this flag is ignored.
1040
+
If [registry-mirror](#flag---registry-mirror) is not set or is empty, this flag
1041
+
is ignored.
1030
1042
1031
1043
#### Flag `--reproducible`
1032
1044
@@ -1040,8 +1052,8 @@ only one layer will be appended to the base image.
1040
1052
1041
1053
#### Flag `--skip-push-permission-check`
1042
1054
1043
-
Set this flag to skip push permission check. This can be useful to delay Kanikos first request for delayed
1044
-
network-policies.
1055
+
Set this flag to skip push permission check. This can be useful to delay Kanikos
1056
+
first request for delayed network-policies.
1045
1057
1046
1058
#### Flag `--skip-tls-verify`
1047
1059
@@ -1065,8 +1077,8 @@ multiple times for multiple registries.
1065
1077
#### Flag `--skip-unused-stages`
1066
1078
1067
1079
This flag builds only used stages if defined to `true`. Otherwise it builds by
1068
-
default all stages, even the unnecessary ones until it reaches the target
1069
-
stage / end of Dockerfile
1080
+
default all stages, even the unnecessary ones until it reaches the target stage
1081
+
/ end of Dockerfile
1070
1082
1071
1083
#### Flag `--snapshot-mode`
1072
1084
@@ -1077,8 +1089,8 @@ kaniko will snapshot the filesystem.
1077
1089
considered when snapshotting. This is the least performant option, but also
1078
1090
the most robust.
1079
1091
1080
-
- If `--snapshot-mode=redo` is set, the file mtime, size, mode, owner uid and gid
1081
-
will be considered when snapshotting. This may be up to 50% faster than
1092
+
- If `--snapshot-mode=redo` is set, the file mtime, size, mode, owner uid and
1093
+
gid will be considered when snapshotting. This may be up to 50% faster than
1082
1094
"full", particularly if your project has a large number files.
1083
1095
1084
1096
- If `--snapshot-mode=time` is set, only file mtime will be considered when
@@ -1096,11 +1108,15 @@ Set this flag to indicate which build stage is the target build stage.
1096
1108
1097
1109
#### Flag `--use-new-run`
1098
1110
1099
-
Using this flag enables an experimental implementation of the Run command which does not rely on snapshotting at all.
1100
-
In this approach, in order to compute which files were changed, a marker file is created before executing the Run command.
1101
-
Then the entire filesystem is walked (takes ~1-3 seconds for 700Kfiles) to find all files whose ModTime is greater than the marker file.
1102
-
With this new run command implementation, the total build time is reduced seeing performance improvements in the range of ~75%. This new run mode trades
1103
-
off accuracy/correctness in some cases (potential for missed files in a "snapshot") for improved performance by avoiding the full filesystem snapshots.
1111
+
Using this flag enables an experimental implementation of the Run command which
1112
+
does not rely on snapshotting at all. In this approach, in order to compute
1113
+
which files were changed, a marker file is created before executing the Run
1114
+
command. Then the entire filesystem is walked (takes ~1-3 seconds for 700Kfiles)
1115
+
to find all files whose ModTime is greater than the marker file. With this new
1116
+
run command implementation, the total build time is reduced seeing performance
1117
+
improvements in the range of ~75%. This new run mode trades off
1118
+
accuracy/correctness in some cases (potential for missed files in a "snapshot")
1119
+
for improved performance by avoiding the full filesystem snapshots.
1104
1120
1105
1121
#### Flag `--verbosity`
1106
1122
@@ -1124,8 +1140,8 @@ image filesystem. Defaults to `0`.
1124
1140
1125
1141
#### Flag `--image-download-retry`
1126
1142
1127
-
Set this flag to the number of retries that should happen when downloading the
1128
-
remote image. Consecutive retries occur with exponential backoff and an initial
1143
+
Set this flag to the number of retries that should happen when downloading the
1144
+
remote image. Consecutive retries occur with exponential backoff and an initial
1129
1145
delay of 1 second. Defaults to 0`.
1130
1146
1131
1147
### Debug Image
@@ -1199,18 +1215,19 @@ profiling,
1199
1215
## Creating Multi-arch Container Manifests Using Kaniko and Manifest-tool
1200
1216
1201
1217
While Kaniko itself currently does not support creating multi-arch manifests
1202
-
(contributions welcome), one can use tools such as [manifest-tool](https://github.com/estesp/manifest-tool)
1203
-
to stitch multiple separate builds together into a single container manifest.
1218
+
(contributions welcome), one can use tools such as
1219
+
[manifest-tool](https://github.com/estesp/manifest-tool) to stitch multiple
1220
+
separate builds together into a single container manifest.
1204
1221
1205
1222
### General Workflow
1206
1223
1207
1224
The general workflow for creating multi-arch manifests is as follows:
1208
1225
1209
1226
1. Build separate container images using Kaniko on build hosts matching your
1210
-
target architecture and tag them with the appropriate ARCH tag.
1227
+
target architecture and tag them with the appropriate ARCH tag.
1211
1228
2. Push the separate images to your container registry.
1212
1229
3. Manifest-tool identifies the separate manifests in your container registry,
1213
-
according to a given template.
1230
+
according to a given template.
1214
1231
4. Manifest-tool pushes a combined manifest referencing the separate manifests.
@@ -1219,27 +1236,30 @@ according to a given template.
1219
1236
1220
1237
The following conditions must be met:
1221
1238
1222
-
1. You need access to build-machines running the desired architectures
1223
-
(running Kaniko in an emulator, e.g. QEMU should also be possible but goes
1224
-
beyond the scope of this documentation). This is something to keep in mind
1225
-
when using SaaS build tools such as github.com or gitlab.com, of which at the
1226
-
time of writing neither supports any non-x86_64 SaaS runners ([GitHub](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources),[GitLab](https://docs.gitlab.com/ee/ci/runners/saas/linux_saas_runner.html#machine-types-available-for-private-projects-x86-64)),
1227
-
so be prepared to bring your own machines ([GitHub](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners),[GitLab](https://docs.gitlab.com/runner/register/).
1239
+
1. You need access to build-machines running the desired architectures (running
1240
+
Kaniko in an emulator, e.g. QEMU should also be possible but goes beyond the
1241
+
scope of this documentation). This is something to keep in mind when using
1242
+
SaaS build tools such as github.com or gitlab.com, of which at the time of
1243
+
writing neither supports any non-x86_64 SaaS runners
2. Kaniko needs to be able to run on the desired architectures. At the time of
1229
-
writing, the official Kaniko container supports[linux/amd64, linux/arm64,
1230
-
linux/s390x and linux/ppc64le (not on *-debug images)](https://github.com/GoogleContainerTools/kaniko/blob/main/.github/workflows/images.yaml).
1248
+
writing, the official Kaniko container supports
1249
+
[linux/amd64, linux/arm64, linux/s390x and linux/ppc64le (not on \*-debug images)](https://github.com/GoogleContainerTools/kaniko/blob/main/.github/workflows/images.yaml).
1231
1250
3. The container registry of your choice must be OCIv1 or Docker v2.2
1232
-
compatible.
1251
+
compatible.
1233
1252
1234
1253
### Example CI Pipeline (GitLab)
1235
1254
1236
-
It is up to you to find an automation tool that suits your needs best.
1237
-
We recommend using a modern CI/CD system such as GitHub workflows or GitLab CI.
1238
-
As we (the authors) happen to use GitLab CI, the following examples are
1239
-
tailored to this specific platform but the underlying principles should apply
1240
-
anywhere else and the examples are kept simple enough, so that you should be
1241
-
able to follow along, even without any previous experiences with this specific
1242
-
platform. When in doubt, visit the [gitlab-ci.yml reference page](https://docs.gitlab.com/ee/ci/yaml/index.html)
1255
+
It is up to you to find an automation tool that suits your needs best. We
1256
+
recommend using a modern CI/CD system such as GitHub workflows or GitLab CI. As
1257
+
we (the authors) happen to use GitLab CI, the following examples are tailored to
1258
+
this specific platform but the underlying principles should apply anywhere else
1259
+
and the examples are kept simple enough, so that you should be able to follow
1260
+
along, even without any previous experiences with this specific platform. When
0 commit comments