How to work with files inside a container?

I deployed a container with a docker compose file and due to the fact that I still don’t really know what I’m doing, I created a mount inside of it that was supposed to be a file. Is there any way to kill the mount and put the file inside the container without destroying and remaking the whole thing?

Manually via CLI or via the WebUI?

Depends what you mean by mount. Bind mount? Absolutely, just stop the container and make your changes. A named volume? A bit more difficult.

I pasted a yaml file into the ‘Add Custom App’ screen in the UI.

I don’t know the answer to your next question.
The line in the file read like so:
./init.sql:/docker-entrypoint-initdb.d/init.sql
And I wasn’t paying attention to the fact that it was referencing a file instead of a directory, so I pasted the line in like so:
/mnt/.ix-apps/app_configs/xwiki/init.sql:/docker-entrypoint-initdb.d/init.sql
So now I have a directory called init.sql inside the container.

And when I stop the image, change the line in the file and click save, it reverts back to what it was. The changes don’t seem to take.

If the file does not already exist, the path will be interpreted as a directory.

Stop the container, open a shell, go to /mnt/.ix-apps/app_configs/xwiki and delete init.sql/.

Then replace it with the init.sql provided in the Github repo you downloaded the compose from, for example this init.sql found at 17/mysql-tomcat/mysql in the xwiki repo.

1 Like

I did it, but init.sql still shows up as a directory after I restart the app.