Removed file after restart in docker container

MrJoki007

Dabbler
Joined
Jul 15, 2018
Messages
45
Hello,
im trying to install EVCC as a docker container from docker hub on Truenas scale.
EVCC generates a config file in /etc folder in the container.
My problem is, that everytime the container is restartet, the file is removed.

How can i change that?
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Hello,
im trying to install EVCC as a docker container from docker hub on Truenas scale.
EVCC generates a config file in /etc folder in the container.
My problem is, that everytime the container is restartet, the file is removed.

How can i change that?

It does not look like the big-blue "launch docker" button supports single-file mounts.
So there is no solution using that.

Our Custom-App App, designed for expert users only!, does allow this though.
HostPath mode, under the advanced hostPath storage option.
 

MrJoki007

Dabbler
Joined
Jul 15, 2018
Messages
45
Is the problem with the removed file only in the etc folder or is it in the complete docker container?

Because if its only the etc folder, i think there is a way of changing the path of the config file.
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
@MrJoki007 you should be easily able to specify the configuration file you want to mount from the storage section while editing your installed application.
You can set "Host Path" to the configuration file where it lives on your host and then specify the path where it should be mounted inside the container/pod.
However i think you are seeing a different issue/case and the file does not exist before but is generated for the first time when the container starts. Even in that case having an empty file initially and mounting it should solve your problem though until the container tries to remove the existing file. Anyways, let me know please if you run into any issues. Thanks!
 

MrJoki007

Dabbler
Joined
Jul 15, 2018
Messages
45
So can i set a single file with host path too? I thought that only works with folders.
 
Top