Cannot modify host files via bootstrap-container (Permission denied) #1957
-
I am running Bottlerocket OS on EC2 instance and i'm trying to configure containerd settings. My user-data here
My bootstrap-container
Problem is here When ec2 execute user-data, permission denied error occurs creating folders and files.
👉 Question: How can i create files under |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @dangen-effy, those permission errors are due to SElinux. Bootstrap container processes do not have the necessary SElinux label to make changes to configuration files in Since the end goal is to configure containerd, this should be done through Bottlerocket’s API system. To best support this use-case, we would need to create new settings for these containerd configuration items. What would you like to see exposed via Bottlerocket settings? |
Beta Was this translation helpful? Give feedback.
-
For anyone finding this while searching, it appears this is now possible via the API. |
Beta Was this translation helpful? Give feedback.
Hi @dangen-effy, those permission errors are due to SElinux. Bootstrap container processes do not have the necessary SElinux label to make changes to configuration files in
/etc
./etc
is atmpfs
mount intended for certain host processes to write generated configuration files and nothing else. Currently bootstrap container processes are labelled withcontrol_t
. You can read more about the labels given to containers here.Since the end goal is to configure containerd, this should be done through Bottlerocket’s API system.
/etc/containerd/config.toml
is rendered by Bottlerocket every time there’s a change to any containerd-related Bottlerocket setting. Bottlerocket would overwrite anything t…