Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Profiles folder overwritten everytime in docker

Hello,

I'm using docker with v2.12.3, everything is working fine except the profiles folder (where the profiles permissions are stored).

I have the following volume mounted with docker compose :

 - /var/docker/ocs/profilesconfdata/_data:/usr/share/ocsinventory-reports/ocsreports/config/profiles

When I edit the permissions, the files in /var/docker/ocs/profilesconfdata/_data are updated, so far so good. But when I stop and start the container, everything is overwritten with the files from the ocs image. It's not persistent. I don't have this kind of problem with the database files for example.

How can I prevent the ocs server from overwritting the files on startup ? It should just read them, but be able to update them if necessary.
ago in OCS Inventory NG server for Unix by (460 points)

4 Answers

–1 vote

A practical workaround is to initialize the configuration once and then reuse it:

  • Start the container without the volume mount.

  • Copy the config directory from the container to the host:

    docker cp <container>:/usr/share/ocsinventory-reports/ocsreports/config /var/docker/ocs/config/geometry dash
  • Stop and remove the container.

  • Mount that directory in docker-compose:

    volumes:
    - /var/docker/ocs/config:/usr/share/ocsinventory-reports/ocsreports/config
ago by (140 points)
–1 vote
This way the container will use the existing configuration instead of replacing the files each time it starts.
ago by (140 points)
0 votes

@

Mounting the whole config folder doesn't change anything. And mounting it as ready only will prevent config changes from the gui.

ago by (460 points)
0 votes
Oh I just noticed your answer was completely unhelpful because you created an account just to post chatgpt's trash. Don't post on the internet if your brain has been eaten by an AI.
ago by (460 points)
 
Powered by Question2Answer
...