Where is my data stored locally?

My environment is a Windows machine running Ubuntu 22.04 in WSL. Inside the Ubuntu instance, I have docker and docker-compose. I want to run an instance of Gibbon which is a school management system. I followed the directions at Docker and it is up and running. However, this is the issue I am running into. I can take run the ‘docker-compose down’ command and it goes down. I can remove the images, and delete the folder it is running in. But if I re-create it by following the instructions again, all my old data is still there. It is not a new instance. I noticed in the yml file the volumes are set up this way.

volumes:
      - my-gibbon:/var/www/gibbon.local/

and:

volumes:
      - my-db:/var/lib/mysql

and then the bottom just says:

volumes:
  my-db:
  my-gibbon:

I am used to a ./ in front of the part that would say my-gibbon so that it would create a data file inside the folder that I am working with. However, when I do that the whole thing crashes. It will not run.

So my question is, where is my database data actually stored? I need to know so I can go and delete it and start a whole new instance. I have even tried renaming the database in hopes that it would force a new one, and it does not. The original data is still there.

No, you don’t really need to know in order to delete it. You should always use docker commands and never remove anything manually unless it is in a folder managed by you. The data is there because docker compose down is for deleting the containers and networks, but not (by default) data. It is because containers have to be recreated sometimes or you want to delete the project, so you can free up the used ip ranges, but persistent data saved on a named volume should never be deleted unless you directly delete it. Use

docker compose down -v

to remove volumes too. or use docker volume commands to manage volumes.

By the way if you are interested in where data is stored, I have a blogpost about it: Everything about Docker volumes - DEV Community

And you should not use docker-compose commands as that is probably Compose v1 which is not developed anymore and Compose v2 is a cli plugin used as I wrote in my examples above. With a space, not a dash.

Thank you so much. I will definitely check out your blog post about Docker Volumes. And thank you for reminding me of the -v option to delete volumes while brining down a container. In all my mucking around I jacked up a lot of things and had to completely remove docker and docker-compose from my system. Well, I don’t know if I really needed to do all that, but it seemed like the fastest way to clean up everything that I jacked up. But it’s back up and running again, thanks to you. Thank you so much for your help.

One more question, if you don’t mind. I don’t know if you went and looked at that docker container site I posted or not. But I can send the git clone command, adjust my .env file and bring the container up it works as expected. However, there is a step in the instructions where you run a docker build command. And if I do that, it will all still come up, but when I go to localhost:8080 it will just give me an apache page with no files there. You know, like an apache server running with no index.html file. It will just give you a blank page with a list of files. But there are no files there. Any idea why that would do that?

You mean the Docker image description? That’s not a container. Since its another issue, I recommend opening a new topic here or an issue on GitHub. I don’t know the app and I can’t be sure what you exactly did to get that result (it worked for me now) and I wouldn’t ask for more details in this topic. My guess is that the installation failed for whatever reason but the build command did not.