redhat-buildpacks / poc

Project to be used to perform go build of images using Buildah, ...
3 stars 6 forks source link

COPY command is failing: failed to get fileinfo for dir:/workspace/hello.txt: lstat dir:/workspace/hello.txt #4

Closed cmoulliard closed 2 years ago

cmoulliard commented 2 years ago

Issue

The following error is reported when kaniko executes a COPY command

INFO[0001] Unpacking rootfs as cmd COPY ./hello.txt /workspace requires it. 
panic: error building stage: failed to get files used from context: failed to get fileinfo for dir:/workspace/hello.txt: lstat dir:/workspace/hello.txt: no such file or directory

goroutine 1 [running]:
main.exportTarball()
        /go/src/kaniko-app/main.go:57 +0xff0
main.main()
        /go/src/kaniko-app/main.go:36 +0x8a

This problem is discussed here: https://github.com/GoogleContainerTools/kaniko/issues/1723

Solution

Change the srcContext from dir:///xxxxx to /xxxxx