Kaniko image fails to build image as it has read only root access

70 views
Skip to first unread message

Sagar Veerla

unread,
Feb 2, 2024, 1:57:26 PM2/2/24
to kaniko-users

Hello all,

we are trying to build container using kaniko over a cluster without previlege access, however it fails with below error

error building image: error building stage: failed to get filesystem from image: error removing bin to make way for new symlink: unlinkat //bin: read-only file system

 

Creating an empty directory at /bin will let this step pass, but errors for other directories will show up the same as above.

How can this be resolved? Any guidane is appreciated.

Thanks,
Sagar


Yossi Cohn

unread,
Feb 3, 2024, 9:16:00 AM2/3/24
to kaniko-users
 We also use Kaniko, I've failed to have it rootless.
What did is to remove all capabilities but few

So the securityContext looks like this

container:
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: false
capabilities:
drop:
- ALL
add:
- CHOWN
- FOWNER
- DAC_OVERRIDE
- SETUID
- SETGID
Reply all
Reply to author
Forward
0 new messages