How do I change a file in my docker.img for a container and keep the changes after a container restart?


Recommended Posts

I opened the file using the console for the docker container, I edited the variables I needed with vi, and I saved the file. 

 

When I restart the container to take advantage of the changes made I can look into the console again with vi and the file reverted to the default. 

 

How can I make a change to the file and ensure the changes are saved after restarting the container?

 

Am I doing this wrong?

Link to comment

actually you shouldn't edit anything in a container because that changes after a update of the container,
all changes should be in your appdata config file of that app.
 

it would help if you tell which container and what you want to do.

Link to comment

The container I'm trying to work with is radarrsync by funkypenguin, it is found in Community Applications.  I need to edit the Config.txt inside the container since there are no variables to edit/paths to edit in the Unraid docker install.  I did try to add them manually but the container didn't recognize them I'd assume since the log spewed errors.

 

I've tried to mount the path that the Config.txt is stored in with Unraid's update container, but the Config.txt is stored in the "/" directory and if I add only / to the container path (and in the host path I just point it to a folder in my appdata) I get the error:

 

"Error response from daemon: invalid volume specification: '/mnt/user/appdata/radarrsync/:/:rw': invalid mount config for type "bind": invalid specification: destination can't be '/'."

 

I ran the command pwd and realpath to verify the container keeps the files in the / directory.

Link to comment
  • 1 year later...

I would like to do similar, I went into the console of linuxserver/mcmyadmin2 container to Update Java to Version 16 for Mineacraft 1.17.1.

 

After restart the Java Update is gone. How can I make it save the changes? I tried this command (0239d37756ae is mcmyadmin2):

 

root@Tower:~# docker commit 0239d37756ae mcmyadmin2-java16
sha256:6576de23caddfa03f9094079da14bff36234e655bdb0e8db82a57dfb9fd4f13f

 

 

The container will not be updated by Linuxserver anymore, the support thread is closed:

 

https://forums.unraid.net/topic/41907-support-linuxserverio-mcmyadmin/

 

Thank you

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.