Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross build fails on Kaniko #813

Open
bearprevent opened this issue Mar 20, 2023 · 0 comments
Open

Cross build fails on Kaniko #813

bearprevent opened this issue Mar 20, 2023 · 0 comments

Comments

@bearprevent
Copy link

Expected behaviour

Using a balenalib image with Kaniko should work as with Docker build.

Actual behaviour

Running the following kaniko executor command with the Dockerfile provided below will yield a link /bin/sh.real /bin/sh: no such file or directory error.

docker run --rm -it --volume ./:/test gcr.io/kaniko-project/executor:debug --context /test --dockerfile /test/Dockerfile --no-push

Error message

INFO[0000] Retrieving image manifest balenalib/armv7hf-debian-python 
INFO[0000] Retrieving image balenalib/armv7hf-debian-python from registry index.docker.io 
INFO[0001] Built cross stage deps: map[]                
INFO[0001] Retrieving image manifest balenalib/armv7hf-debian-python 
INFO[0001] Returning cached image manifest              
INFO[0001] Executing 0 build triggers                   
INFO[0001] Building stage 'balenalib/armv7hf-debian-python' [idx: '0', base-idx: '-1'] 
INFO[0001] Unpacking rootfs as cmd RUN ["cross-build-start"] requires it. 
INFO[0006] RUN ["cross-build-start"]                    
INFO[0006] Initializing snapshotter ...                 
INFO[0006] Taking snapshot of full filesystem...        
INFO[0010] Cmd: /usr/bin/cross-build-start              
INFO[0010] Args: []                                     
INFO[0010] Running: [/usr/bin/cross-build-start]        
2023/03/20 09:31:22 link /bin/sh.real /bin/sh: no such file or directory
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1

Additional information

Dockerfile

FROM balenalib/armv7hf-debian-python

RUN ["cross-build-start"]

RUN pip install --upgrade pip

RUN ["cross-build-end"]

Docker build

This will work as expected:

docker build .

Kaniko executor

This will fail:

docker run --rm -it --volume ./:/test gcr.io/kaniko-project/executor:debug --context /test --dockerfile /test/Dockerfile --no-push

Workaround

I documented a workaround at kaniko #1556: I replaced resin-xbuild by a custom build of https://github.com/balena-io-library/armv7hf-debian-qemu/blob/master/resin-xbuild.go.

@bearprevent bearprevent changed the title Cross build failes on Kaniko Cross build fails on Kaniko Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant