mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-06 02:31:23 +02:00
Merge pull request #1234 from tejal29/fix_copy_from
Apply dockefile exclude only for first stage
This commit is contained in:
@@ -73,6 +73,7 @@ var whitelist = initialWhitelist
|
||||
var volumes = []string{}
|
||||
|
||||
var excluded []string
|
||||
var IsFirstStage = true
|
||||
|
||||
type ExtractFunction func(string, *tar.Header, io.Reader) error
|
||||
|
||||
@@ -678,6 +679,10 @@ func GetExcludedFiles(dockerfilepath string, buildcontext string) error {
|
||||
|
||||
// ExcludeFile returns true if the .dockerignore specified this file should be ignored
|
||||
func ExcludeFile(path, buildcontext string) bool {
|
||||
// Apply dockerfile excludes for first stage only
|
||||
if !IsFirstStage {
|
||||
return false
|
||||
}
|
||||
if HasFilepathPrefix(path, buildcontext, false) {
|
||||
var err error
|
||||
path, err = filepath.Rel(buildcontext, path)
|
||||
|
||||
Reference in New Issue
Block a user