This repository contains a minimal test case for a bug found in the Harness implementation of the Kaniko builder. The bug manifests when parsing .dockerignore
files.
The bug occurs when a .dockerignore
file is configured to ignore all files by default and only includes certain files through exceptions. If a filename in the exceptions list contains a +
symbol, the file is not correctly unignored and remains excluded from the build context.
-
Run the following command to build the Docker image using the Harness-Kaniko builder:
make build
Notice that the file
a+b.patch
is not copied into the Docker image. -
Run the following command to build the Docker image using the upstream Kaniko project:
make build_google
In this case, the file
a+b.patch
is correctly copied into the Docker image.
This discrepancy between the two builders demonstrates the bug in the Harness-Kaniko builder's handling of .dockerignore
files.