From 92d921664629ef8112742a2f165e2284ee61a09b Mon Sep 17 00:00:00 2001 From: Jaewon Date: Wed, 25 Mar 2026 12:04:30 -0700 Subject: [PATCH 1/8] Use dockerignore --- pkg/build/build.go | 5 ++- pkg/build/buildopts.go | 94 +++++++++++++++++++++++------------------- pkg/fssync/diffcopy.go | 50 +++++++++++++++++++--- pkg/fssync/fssync.go | 9 +++- 4 files changed, 107 insertions(+), 51 deletions(-) diff --git a/pkg/build/build.go b/pkg/build/build.go index 0178a4e..353507d 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -137,9 +137,10 @@ func Build(ctx context.Context, opts *BOpts) error { KeyContentStoreName: opts.ContentStore, } - if opts.HiddenDockerDir != "" { - solveOpt.FrontendAttrs["filename"] = filepath.Join(opts.HiddenDockerDir, "Dockerfile") + if len(opts.Dockerignore) > 0 { + solveOpt.FrontendAttrs["filename"] = "com.apple.container/Dockerfile" } + logrus.Debugf("solveOpt.FrontendAttrs[filename]=%v", solveOpt.FrontendAttrs["filename"]) if opts.NoCache { solveOpt.FrontendAttrs["no-cache"] = "" diff --git a/pkg/build/buildopts.go b/pkg/build/buildopts.go index 432db38..bb709fd 100644 --- a/pkg/build/buildopts.go +++ b/pkg/build/buildopts.go @@ -28,6 +28,7 @@ import ( "github.com/moby/buildkit/frontend/dockerfile/parser" "github.com/moby/buildkit/util/progress/progresswriter" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" + "github.com/sirupsen/logrus" "github.com/apple/container-builder-shim/pkg/build/utils" "github.com/apple/container-builder-shim/pkg/content" @@ -41,9 +42,8 @@ const ( KeyContentStoreName = "container" // Base64-encoded Dockerfile contents. KeyDockerfile = "dockerfile" - // Hidden directory for the dockerfile and dockerignore to be placed. - // This is provided when docker specific ignore file is found, which might live outside the build context. - KeyHiddenDockerDir = "hidden-docker-dir" + // Base64-encoded Dockerignore contents. + KeyDockerignore = "dockerignore" // Image reference (name:tag) to assign to the built image. KeyTag = "tag" // Target platforms to build the image for. @@ -79,22 +79,22 @@ const ( var keyBOpts = struct{}{} type BOpts struct { - BuildID string - Dockerfile []byte - Tag string - ContextDir string - HiddenDockerDir string - BuildPlatforms []ocispecs.Platform - Platforms []ocispecs.Platform - NoCache bool - Target string - BuildArgs map[string]string - Secrets map[string][]byte - CacheIn []string - CacheOut []string - Outputs []string - Labels map[string]string - ProgressWriter progresswriter.Writer + BuildID string + Dockerfile []byte + Dockerignore []byte + Tag string + ContextDir string + BuildPlatforms []ocispecs.Platform + Platforms []ocispecs.Platform + NoCache bool + Target string + BuildArgs map[string]string + Secrets map[string][]byte + CacheIn []string + CacheOut []string + Outputs []string + Labels map[string]string + ProgressWriter progresswriter.Writer ContentStore *content.ContentStoreProxy Resolver *resolver.ResolverProxy @@ -128,7 +128,15 @@ func NewBuildOpts(ctx context.Context, basePath string, contextMap map[string][] return nil, err } - hiddenDockerDir, _ := first(KeyHiddenDockerDir) + dockerignoreBase64Bytes, ok := first(KeyDockerignore) + + dockerignoreBytes := []byte{} + if ok { + dockerignoreBytes, err = base64.StdEncoding.DecodeString(dockerignoreBase64Bytes) + if err != nil { + return nil, err + } + } progress, ok := first(KeyProgress) if !ok { @@ -293,7 +301,7 @@ func NewBuildOpts(ctx context.Context, basePath string, contextMap map[string][] } } - fssyncProxy, err := fssync.NewFSSyncProxy(".", basePath, addedGlobs) + fssyncProxy, err := fssync.NewFSSyncProxy(".", basePath, addedGlobs, dockerfileBytes, dockerignoreBytes) if err != nil { return nil, err } @@ -304,29 +312,31 @@ func NewBuildOpts(ctx context.Context, basePath string, contextMap map[string][] } bopts := &BOpts{ - BuildID: buildID, - Dockerfile: dockerfileBytes, - Tag: tag, - BuildPlatforms: bps, - Platforms: pls, - ContextDir: ctxDir, - HiddenDockerDir: hiddenDockerDir, - ContentStore: contentProxy, - FSSync: fssyncProxy, - NoCache: noCache, - Resolver: resolver.NewResolverProxy(), - ProgressWriter: pw, - Stdio: stdioProxy, - Target: target, - Labels: labels, - BuildArgs: buildArgs, - Secrets: secrets, - CacheIn: cacheIn, - CacheOut: cacheOut, - Outputs: outputs, - basePath: filepath.Join(basePath, buildID), + BuildID: buildID, + Dockerfile: dockerfileBytes, + Dockerignore: dockerignoreBytes, + Tag: tag, + BuildPlatforms: bps, + Platforms: pls, + ContextDir: ctxDir, + ContentStore: contentProxy, + FSSync: fssyncProxy, + NoCache: noCache, + Resolver: resolver.NewResolverProxy(), + ProgressWriter: pw, + Stdio: stdioProxy, + Target: target, + Labels: labels, + BuildArgs: buildArgs, + Secrets: secrets, + CacheIn: cacheIn, + CacheOut: cacheOut, + Outputs: outputs, + basePath: filepath.Join(basePath, buildID), } + logrus.Debugf("bopts.Dockerignore: %v", string(dockerignoreBytes)) + return bopts, nil } diff --git a/pkg/fssync/diffcopy.go b/pkg/fssync/diffcopy.go index 5f6d6d6..3d97100 100644 --- a/pkg/fssync/diffcopy.go +++ b/pkg/fssync/diffcopy.go @@ -17,6 +17,7 @@ package fssync import ( + "bytes" "context" "io" "io/fs" @@ -26,6 +27,7 @@ import ( "github.com/moby/buildkit/session/filesync" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/tonistiigi/fsutil/types" "golang.org/x/sync/errgroup" ) @@ -141,12 +143,29 @@ func (s *sender) queue(id uint32) error { } func (s *sender) sendFile(h *sendHandle) error { - f, err := s.fs.Open(h.path) - if err == nil { - defer f.Close() - buf := bufPool.Get().(*[]byte) - defer bufPool.Put(buf) - if _, err := io.CopyBuffer(&fileSender{sender: s, id: h.id}, struct{ io.Reader }{f}, *buf); err != nil { + logrus.Debugf("sendFile: %v", h.path) + + var r io.Reader + buf := bufPool.Get().(*[]byte) + defer bufPool.Put(buf) + + switch h.path { + case "com.apple.container/Dockerfile": + r = bytes.NewReader(s.fs.proxy.dockerfile) + case "com.apple.container/Dockerfile.ignore": + r = bytes.NewReader(s.fs.proxy.dockerignore) + } + + if r == nil { + f, err := s.fs.Open(h.path) + if err == nil { + defer f.Close() + if _, err := io.CopyBuffer(&fileSender{sender: s, id: h.id}, struct{ io.Reader }{f}, *buf); err != nil { + return err + } + } + } else { + if _, err := io.CopyBuffer(&fileSender{sender: s, id: h.id}, r, *buf); err != nil { return err } } @@ -183,6 +202,25 @@ func (s *sender) walk(ctx context.Context) error { if err != nil { return err } + + proxy := s.fs.proxy + syntheticStats := []*types.Stat{ + {Path: "com.apple.container", Mode: uint32(os.ModeDir | 0755)}, + {Path: "com.apple.container/Dockerfile", Mode: uint32(0644), Size: int64(len(proxy.dockerfile))}, + {Path: "com.apple.container/Dockerfile.ignore", Mode: uint32(0644), Size: int64(len(proxy.dockerignore))}, + } + for _, stat := range syntheticStats { + if fileCanRequestData(os.FileMode(stat.Mode)) { + s.mu.Lock() + s.files[i] = stat.Path + s.mu.Unlock() + } + i++ + if err := s.conn.SendMsg(&types.Packet{Type: types.PACKET_STAT, Stat: stat}); err != nil { + return errors.Wrapf(err, "failed to send stat %s", stat.Path) + } + } + return errors.Wrapf(s.conn.SendMsg(&types.Packet{Type: types.PACKET_STAT}), "failed to send last stat") } diff --git a/pkg/fssync/fssync.go b/pkg/fssync/fssync.go index 0d094f1..82604eb 100644 --- a/pkg/fssync/fssync.go +++ b/pkg/fssync/fssync.go @@ -46,14 +46,21 @@ type FSSyncProxy struct { basePath string addedGlobs []string + + dockerfile []byte + dockerignore []byte } -func NewFSSyncProxy(contextDir string, basePath string, addedGlobs []string) (*FSSyncProxy, error) { +func NewFSSyncProxy(contextDir string, basePath string, addedGlobs []string, + dockerfile []byte, dockerignore []byte) (*FSSyncProxy, error) { f := new(FSSyncProxy) f.contextDir = contextDir f.basePath = filepath.Join(basePath, f.String()) f.addedGlobs = addedGlobs + + f.dockerfile = dockerfile + f.dockerignore = dockerignore return f, nil } From 2dbd3aa140711d00166186e47143851ba69c6f08 Mon Sep 17 00:00:00 2001 From: Jaewon Date: Wed, 25 Mar 2026 16:09:52 -0700 Subject: [PATCH 2/8] Stage dockerfile and dockerignore under context --- pkg/build/build.go | 3 +-- pkg/build/buildopts.go | 9 ++++++--- pkg/fileutils/tarxfer.go | 34 +++++++++++++++++++++++++++++++++- pkg/fssync/diffcopy.go | 23 +++-------------------- pkg/fssync/fssync.go | 2 ++ pkg/fssync/walk.go | 17 +++++++++-------- 6 files changed, 54 insertions(+), 34 deletions(-) diff --git a/pkg/build/build.go b/pkg/build/build.go index 353507d..7ea5e2b 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -138,9 +138,8 @@ func Build(ctx context.Context, opts *BOpts) error { } if len(opts.Dockerignore) > 0 { - solveOpt.FrontendAttrs["filename"] = "com.apple.container/Dockerfile" + solveOpt.FrontendAttrs["filename"] = filepath.Join(DockerfileStaging, "Dockerfile") } - logrus.Debugf("solveOpt.FrontendAttrs[filename]=%v", solveOpt.FrontendAttrs["filename"]) if opts.NoCache { solveOpt.FrontendAttrs["no-cache"] = "" diff --git a/pkg/build/buildopts.go b/pkg/build/buildopts.go index bb709fd..ca5b5fe 100644 --- a/pkg/build/buildopts.go +++ b/pkg/build/buildopts.go @@ -28,7 +28,6 @@ import ( "github.com/moby/buildkit/frontend/dockerfile/parser" "github.com/moby/buildkit/util/progress/progresswriter" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/sirupsen/logrus" "github.com/apple/container-builder-shim/pkg/build/utils" "github.com/apple/container-builder-shim/pkg/content" @@ -73,7 +72,11 @@ const ( ) const ( + // Used to share built artifacts outside VM GlobalExportPath = "/var/lib/container-builder-shim/exports" + // If KeyDockerignore argument is provided, Dockerfile and ignore file are + // staged at DockerfileStaging directory, and buildkit uses them. + DockerfileStaging = fssync.DockerfileStaging ) var keyBOpts = struct{}{} @@ -136,6 +139,8 @@ func NewBuildOpts(ctx context.Context, basePath string, contextMap map[string][] if err != nil { return nil, err } + + dockerignoreBytes = append(dockerignoreBytes, []byte("\n"+DockerfileStaging)...) } progress, ok := first(KeyProgress) @@ -335,8 +340,6 @@ func NewBuildOpts(ctx context.Context, basePath string, contextMap map[string][] basePath: filepath.Join(basePath, buildID), } - logrus.Debugf("bopts.Dockerignore: %v", string(dockerignoreBytes)) - return bopts, nil } diff --git a/pkg/fileutils/tarxfer.go b/pkg/fileutils/tarxfer.go index 964e88c..e6701ea 100644 --- a/pkg/fileutils/tarxfer.go +++ b/pkg/fileutils/tarxfer.go @@ -26,6 +26,7 @@ import ( "path/filepath" "strings" + "github.com/apple/container-builder-shim/pkg/fssync" "github.com/apple/container-builder-shim/pkg/stream" ) @@ -40,7 +41,7 @@ func NewTarReceiver(cacheBase string, demux *stream.Demultiplexer) *Receiver { return &Receiver{demux: demux, cacheBase: cacheBase} } -func (r *Receiver) Receive(ctx context.Context, fn fs.WalkDirFunc) (string, error) { +func (r *Receiver) Receive(ctx context.Context, dockerfile, dockerignore []byte, fn fs.WalkDirFunc) (string, error) { errCh := make(chan error, 1) hashCh := make(chan string, 1) dataCh := make(chan []byte) @@ -85,6 +86,12 @@ func (r *Receiver) Receive(ctx context.Context, fn fs.WalkDirFunc) (string, erro _ = os.Remove(tarFile) } + if len(dockerignore) > 0 { + if err := stageDockerfiles(ctx, cacheDir, dockerfile, dockerignore); err != nil { + return "", err + } + } + return checksum, filepath.Walk(cacheDir, func(p string, info os.FileInfo, _ error) error { rel, err := filepath.Rel(cacheDir, p) if err != nil || rel == "." { @@ -310,3 +317,28 @@ func unpackTar(ctx context.Context, tarFile, dest string) error { } return nil } + +func stageDockerfiles(ctx context.Context, cacheDir string, dockerfile, dockerignore []byte) error { + staging := filepath.Join(cacheDir, fssync.DockerfileStaging) + if err := os.MkdirAll(staging, 0o755); err != nil { + return err + } + + dockerfilePath := filepath.Join(staging, "Dockerfile") + f, err := os.OpenFile(dockerfilePath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o644) + if err != nil { + return err + } + f.Write(dockerfile) + f.Close() + + dockerignorePath := filepath.Join(staging, "Dockerfile.dockerignore") + f, err = os.OpenFile(dockerignorePath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o644) + if err != nil { + return err + } + f.Write(dockerignore) + f.Close() + + return nil +} diff --git a/pkg/fssync/diffcopy.go b/pkg/fssync/diffcopy.go index 3d97100..474b0ab 100644 --- a/pkg/fssync/diffcopy.go +++ b/pkg/fssync/diffcopy.go @@ -22,6 +22,7 @@ import ( "io" "io/fs" "os" + "path/filepath" "sync" "syscall" @@ -150,9 +151,9 @@ func (s *sender) sendFile(h *sendHandle) error { defer bufPool.Put(buf) switch h.path { - case "com.apple.container/Dockerfile": + case filepath.Join(DockerfileStaging, "Dockerfile"): r = bytes.NewReader(s.fs.proxy.dockerfile) - case "com.apple.container/Dockerfile.ignore": + case filepath.Join(DockerfileStaging, "Dockerfile.dockerignore"): r = bytes.NewReader(s.fs.proxy.dockerignore) } @@ -203,24 +204,6 @@ func (s *sender) walk(ctx context.Context) error { return err } - proxy := s.fs.proxy - syntheticStats := []*types.Stat{ - {Path: "com.apple.container", Mode: uint32(os.ModeDir | 0755)}, - {Path: "com.apple.container/Dockerfile", Mode: uint32(0644), Size: int64(len(proxy.dockerfile))}, - {Path: "com.apple.container/Dockerfile.ignore", Mode: uint32(0644), Size: int64(len(proxy.dockerignore))}, - } - for _, stat := range syntheticStats { - if fileCanRequestData(os.FileMode(stat.Mode)) { - s.mu.Lock() - s.files[i] = stat.Path - s.mu.Unlock() - } - i++ - if err := s.conn.SendMsg(&types.Packet{Type: types.PACKET_STAT, Stat: stat}); err != nil { - return errors.Wrapf(err, "failed to send stat %s", stat.Path) - } - } - return errors.Wrapf(s.conn.SendMsg(&types.Packet{Type: types.PACKET_STAT}), "failed to send last stat") } diff --git a/pkg/fssync/fssync.go b/pkg/fssync/fssync.go index 82604eb..6ab674f 100644 --- a/pkg/fssync/fssync.go +++ b/pkg/fssync/fssync.go @@ -30,6 +30,8 @@ import ( "google.golang.org/grpc" ) +const DockerfileStaging = ".com.apple.container" + var ( _ stream.Stage = &FSSyncProxy{} _ session.Attachable = &FSSyncProxy{} diff --git a/pkg/fssync/walk.go b/pkg/fssync/walk.go index 53df3f5..7715f6a 100644 --- a/pkg/fssync/walk.go +++ b/pkg/fssync/walk.go @@ -124,14 +124,15 @@ func (f *FS) Walk(ctx context.Context, target string, fn fs.WalkDirFunc) error { switch walkMeta.Mode { case ModeTAR: receiver := fileutils.NewTarReceiver(f.fsPath, demux) - checksum, err := receiver.Receive(ctx, func(path string, d fs.DirEntry, err error) error { - excluded, err := excludeMatcher.MatchesOrParentMatches(path) - if excluded { - return nil - } - - return fn(path, d, err) - }) + checksum, err := receiver.Receive(ctx, f.proxy.dockerfile, f.proxy.dockerignore, + func(path string, d fs.DirEntry, err error) error { + excluded, err := excludeMatcher.MatchesOrParentMatches(path) + if excluded { + return nil + } + + return fn(path, d, err) + }) if err != nil { return err } From 84deec55ca0e1d6ef41e24e2861c05c1fddf3b8c Mon Sep 17 00:00:00 2001 From: Jaewon Date: Wed, 25 Mar 2026 16:15:48 -0700 Subject: [PATCH 3/8] Avoid import cycle --- pkg/fileutils/tarxfer.go | 5 +++-- pkg/fssync/fssync.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/fileutils/tarxfer.go b/pkg/fileutils/tarxfer.go index e6701ea..4a8612e 100644 --- a/pkg/fileutils/tarxfer.go +++ b/pkg/fileutils/tarxfer.go @@ -26,10 +26,11 @@ import ( "path/filepath" "strings" - "github.com/apple/container-builder-shim/pkg/fssync" "github.com/apple/container-builder-shim/pkg/stream" ) +const DockerfileStaging = ".com.apple.container" + // Receiver streams a remote tar archive, caches it under cacheBase and calls fn // for every entry that is a regular file, directory or symlink. type Receiver struct { @@ -319,7 +320,7 @@ func unpackTar(ctx context.Context, tarFile, dest string) error { } func stageDockerfiles(ctx context.Context, cacheDir string, dockerfile, dockerignore []byte) error { - staging := filepath.Join(cacheDir, fssync.DockerfileStaging) + staging := filepath.Join(cacheDir, DockerfileStaging) if err := os.MkdirAll(staging, 0o755); err != nil { return err } diff --git a/pkg/fssync/fssync.go b/pkg/fssync/fssync.go index 6ab674f..595d676 100644 --- a/pkg/fssync/fssync.go +++ b/pkg/fssync/fssync.go @@ -25,12 +25,13 @@ import ( "github.com/moby/buildkit/session/filesync" "github.com/apple/container-builder-shim/pkg/api" + "github.com/apple/container-builder-shim/pkg/fileutils" "github.com/apple/container-builder-shim/pkg/stream" "google.golang.org/grpc" ) -const DockerfileStaging = ".com.apple.container" +const DockerfileStaging = fileutils.DockerfileStaging var ( _ stream.Stage = &FSSyncProxy{} From 62d1a6a9280c197bbf6f42d6145407464ebb83cc Mon Sep 17 00:00:00 2001 From: Jaewon Date: Wed, 25 Mar 2026 16:22:22 -0700 Subject: [PATCH 4/8] Remove logging --- pkg/fssync/diffcopy.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/fssync/diffcopy.go b/pkg/fssync/diffcopy.go index 474b0ab..2546da2 100644 --- a/pkg/fssync/diffcopy.go +++ b/pkg/fssync/diffcopy.go @@ -28,7 +28,6 @@ import ( "github.com/moby/buildkit/session/filesync" "github.com/pkg/errors" - "github.com/sirupsen/logrus" "github.com/tonistiigi/fsutil/types" "golang.org/x/sync/errgroup" ) @@ -144,8 +143,6 @@ func (s *sender) queue(id uint32) error { } func (s *sender) sendFile(h *sendHandle) error { - logrus.Debugf("sendFile: %v", h.path) - var r io.Reader buf := bufPool.Get().(*[]byte) defer bufPool.Put(buf) From b8e5ecb69c61275a28854f8e319151bd040ca2df Mon Sep 17 00:00:00 2001 From: Jaewon Date: Wed, 25 Mar 2026 16:39:23 -0700 Subject: [PATCH 5/8] Deny if build context already have file at DockerfileStaging --- pkg/fileutils/tarxfer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/fileutils/tarxfer.go b/pkg/fileutils/tarxfer.go index 4a8612e..a289a4d 100644 --- a/pkg/fileutils/tarxfer.go +++ b/pkg/fileutils/tarxfer.go @@ -278,6 +278,9 @@ func unpackTar(ctx context.Context, tarFile, dest string) error { if err != nil { return err } + if hdr.Name == DockerfileStaging { + return fmt.Errorf("cannot use reserved path: %s", hdr.Name) + } target := filepath.Join(dest, hdr.Name) if !strings.HasPrefix(target, filepath.Clean(dest)+string(os.PathSeparator)) { return fmt.Errorf("invalid tar path: %s", hdr.Name) From fa70d6929bfd182e2ca63dee5a7b5d96ad427e11 Mon Sep 17 00:00:00 2001 From: Jaewon Date: Wed, 25 Mar 2026 16:45:20 -0700 Subject: [PATCH 6/8] Fix test --- pkg/fileutils/tarxfer_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/fileutils/tarxfer_test.go b/pkg/fileutils/tarxfer_test.go index 294c11c..e36de8f 100644 --- a/pkg/fileutils/tarxfer_test.go +++ b/pkg/fileutils/tarxfer_test.go @@ -95,7 +95,7 @@ func TestReceiver_Receive_Success(t *testing.T) { return nil } - checksum, err := r.Receive(ctx, walkFn) + checksum, err := r.Receive(ctx, []byte{}, []byte{}, walkFn) if err != nil { t.Fatalf("Receive returned error: %v", err) } @@ -125,7 +125,7 @@ func TestReceiver_Receive_ServerError(t *testing.T) { tmpDir := t.TempDir() r := NewTarReceiver(tmpDir, demux) - _, err := r.Receive(ctx, func(string, fs.DirEntry, error) error { return nil }) + _, err := r.Receive(ctx, []byte{}, []byte{}, func(string, fs.DirEntry, error) error { return nil }) if err == nil { t.Fatalf("expected server error, got nil") } From f5b04765dab55c9be5b0ef0193dc755d5a278a52 Mon Sep 17 00:00:00 2001 From: jwhur <57657645+JaewonHur@users.noreply.github.com> Date: Thu, 16 Apr 2026 09:26:15 -0700 Subject: [PATCH 7/8] Update pkg/fileutils/tarxfer.go Co-authored-by: Saehej Kang <20051028+saehejkang@users.noreply.github.com> --- pkg/fileutils/tarxfer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fileutils/tarxfer.go b/pkg/fileutils/tarxfer.go index a289a4d..2b4fc1e 100644 --- a/pkg/fileutils/tarxfer.go +++ b/pkg/fileutils/tarxfer.go @@ -42,7 +42,7 @@ func NewTarReceiver(cacheBase string, demux *stream.Demultiplexer) *Receiver { return &Receiver{demux: demux, cacheBase: cacheBase} } -func (r *Receiver) Receive(ctx context.Context, dockerfile, dockerignore []byte, fn fs.WalkDirFunc) (string, error) { +func (r *Receiver) Receive(ctx context.Context, dockerfile []byte, dockerignore []byte, fn fs.WalkDirFunc) (string, error) { errCh := make(chan error, 1) hashCh := make(chan string, 1) dataCh := make(chan []byte) From 8ddbfcff4bc9d0e6654b1437a29b8df9424217d3 Mon Sep 17 00:00:00 2001 From: jwhur <57657645+JaewonHur@users.noreply.github.com> Date: Thu, 16 Apr 2026 09:26:26 -0700 Subject: [PATCH 8/8] Update pkg/fileutils/tarxfer.go Co-authored-by: Saehej Kang <20051028+saehejkang@users.noreply.github.com> --- pkg/fileutils/tarxfer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fileutils/tarxfer.go b/pkg/fileutils/tarxfer.go index 2b4fc1e..b3145b0 100644 --- a/pkg/fileutils/tarxfer.go +++ b/pkg/fileutils/tarxfer.go @@ -322,7 +322,7 @@ func unpackTar(ctx context.Context, tarFile, dest string) error { return nil } -func stageDockerfiles(ctx context.Context, cacheDir string, dockerfile, dockerignore []byte) error { +func stageDockerfiles(ctx context.Context, cacheDir string, dockerfile []byte, dockerignore []byte) error { staging := filepath.Join(cacheDir, DockerfileStaging) if err := os.MkdirAll(staging, 0o755); err != nil { return err