Container Help : How to edit a file inside a container shell?

Complete newbie to both linux and TrueNAS here.

I installed mariadb app from the discover list, I am trying to access mariadb from Cloudbeaver app.
From MariaDB Remote Access Configuration Guide a change has to be made to file /etc/mysql/my.cnf

I can read my.cnf from within container shell, either from Apps Page>mariadb>Workloads>Containers>shell or System>shell>docker ps>docker exec -it ps
However, in either case I am not able to edit my.cnf, vim,vi, or nano are not installed and cat > my.cnf returns permission denied, sudo command is not found while inside container shell.

I have no idea what else to try.

Thanks

Not an expert here - but containers are ephemeral - you can’t edit them and expect the changes to remain over a reboot.

What you need to do is map the folder / file you need to edit to somewhere else on the computer that is permanent. This mapping replaces the location inside the container and is permanent and can be edited.

Lets hope that someone else can explain it better

2 Likes

You can install the editor inside the container (apt or apk), you will lose It on next upgrade/restart.
Or you can mount the dataset via SMB and edit It from pc

1 Like