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
Actual behavior
Directories listed in .dockerignore via **/someDir/ pattern are initially excluded from copying but files within those directories are created.
INFO[0005] WORKDIR /build
INFO[0005] cmd: workdir
INFO[0005] Changed working directory to /build
INFO[0005] Creating directory /build
TRAC[0005] Resolving paths [/build]
INFO[0005] Taking snapshot of files...
DEBU[0005] Taking snapshot of files [/build /]
DEBU[0005] Resolved . to .
DEBU[0005] Resolved . to .
DEBU[0005] Using files from context: [/workspace]
INFO[0005] COPY . .
DEBU[0005] Resolved . to .
DEBU[0005] Resolved . to .
TRAC[0005] Updating destination path from /build/ to /build due to symlink
DEBU[0005] Getting files and contents at root /workspace/ for /workspace
TRAC[0005] Creating directory /build
DEBU[0005] Skipping excluded path: .dockerignore
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Copying file /workspace/Dockerfile to /build/Dockerfile
DEBU[0005] Skipping excluded path: bin
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Copying file /workspace/bin/dummy.txt to /build/bin/dummy.txt
TRAC[0005] baseDir /build/bin for file /build/bin/dummy.txt does not exist. Creating.
DEBU[0005] Copying file /workspace/kaniko-build.sh to /build/kaniko-build.sh
DEBU[0005] Skipping excluded path: obj
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Copying file /workspace/obj/dummy.txt to /build/obj/dummy.txt
TRAC[0005] baseDir /build/obj for file /build/obj/dummy.txt does not exist. Creating.
DEBU[0005] Copying file /workspace/root.txt to /build/root.txt
TRAC[0005] Creating directory /build/subfolder
DEBU[0005] Skipping excluded path: subfolder/bin
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Skipping excluded path: subfolder/bin/dummy.txt
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Skipping excluded path: subfolder/obj
DEBU[0005] /workspace/ found in .dockerignore, ignoring
TRAC[0005] Creating directory /build/subfolder/subfolder2
DEBU[0005] Skipping excluded path: subfolder/subfolder2/bin
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Copying file /workspace/subfolder/subfolder2/bin/dummy.txt to /build/subfolder/subfolder2/bin/dummy.txt
TRAC[0005] baseDir /build/subfolder/subfolder2/bin for file /build/subfolder/subfolder2/bin/dummy.txt does not exist. Creating.
DEBU[0005] Skipping excluded path: subfolder/subfolder2/obj
DEBU[0005] /workspace/ found in .dockerignore, ignoring
DEBU[0005] Copying file /workspace/subfolder/subfolder2/obj/dummy.txt to /build/subfolder/subfolder2/obj/dummy.txt
TRAC[0005] baseDir /build/subfolder/subfolder2/obj for file /build/subfolder/subfolder2/obj/dummy.txt does not exist. Creating.
TRAC[0005] Resolving paths [/build /build/Dockerfile /build/bin/dummy.txt /build/kaniko-build.sh /build/obj/dummy.txt /build/root.txt /build/subfolder /build/subfolder/subfolder2 /build/subfolder/subfolder2/bin/dummy.txt /build/subfolder/subfolder2/obj/dummy.txt]
INFO[0005] Taking snapshot of files...
DEBU[0005] Taking snapshot of files [/build/subfolder /build/subfolder/subfolder2/bin/dummy.txt /build/subfolder/subfolder2/bin /build/bin/dummy.txt /build/Dockerfile /build/bin /build/obj/dummy.txt /build/root.txt /build/subfolder/subfolder2 /build/subfolder/subfolder2/obj/dummy.txt /build /build/obj /build/kaniko-build.sh /build/subfolder/subfolder2/obj /]
Expected behavior
Current docker behavior is that an excluded directory does not have any of its contents copied.
.net core builds fail with an error due to user machine specific paths existing in files in those subfolders which do not existing in the .net core docker image mcr.microsoft.com/dotnet/core/sdk:2.2-alpine :
/usr/share/dotnet/sdk/2.2.207/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: The "ResolvePackageAssets" task failed unexpectedly.
/usr/share/dotnet/sdk/2.2.207/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error MSB4018: NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder '/usr/local/share/dotnet/sdk/NuGetFallbackFolder'.
In an actual application build, if all obj and bin folders are deleted from the project before running the build, no error results.
Triage Notes for the Maintainers
Description
Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
The text was updated successfully, but these errors were encountered:
Actual behavior
Directories listed in .dockerignore via
**/someDir/
pattern are initially excluded from copying but files within those directories are created.Expected behavior
Current docker behavior is that an excluded directory does not have any of its contents copied.
To Reproduce
kaniko-dockerignore-issue.zip
./kaniko-build.sh
Additional Information
Build Context
Kaniko Image
gcr.io/kaniko-project/executor:debug
sha256:0f27b0674797b56db08010dff799c8926c4e9816454ca56cc7844df228c53485
Execution command
.net core builds fail with an error due to user machine specific paths existing in files in those subfolders which do not existing in the .net core docker image
mcr.microsoft.com/dotnet/core/sdk:2.2-alpine
:In an actual application build, if all
obj
andbin
folders are deleted from the project before running the build, no error results.Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: