skip to Main Content

I use docker-transmission container with docker-compose to run transmission app. The docker-compose file contains the following simple volume mapping:

    volumes:
  - ./data:/config

The transmission app configuration file is stored in /config/settings.json and is created every time the container restarts. I need to make certain customization into the configuration. If I do it manually, it’s overwritten with the default config when the container restarts. What is the proper way to either prevent the config file to be rewritten or to replace the newly created default config file with my custom one? Prbably the latter should be the preferred way… Or mabe there’re options 3, 4, 5…

2

Answers


  1. Chosen as BEST ANSWER

    Well, it appeared to be much simplier... I didn't manage to mention that all this happens on QNAP NAS and container station... Assumed that this doesn't matter... But I was wrong... It appeared that the native behaviour of container station is when I map the volume to the home folder of application, it wipes its content when app is recreated. Once I move the data to a different location on disk, no issues


  2. You can try to set the bind mount to read only. This will prevent the container from being able to write to it.

    volumes:
      - ./data:/config:ro
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search