docker volume prune

05/25/2021 , 2m, 58s

Hello friends so I mostly recording this one so that I can hopefully not forget it because I was working with doctor yesterday and I don't work with Docker a lot but I'm kind of thinking about in the next version of Epic React. I want to take the application that we build and make it even more real world.

We're going to jump off of Create. React app and use Remix. Don't worry, they're probably going to have some sort of free tier or a trial version or something. So, I'm not going to force people to have a license to remix to take epic react. But I do want to teach you the the best way to build React applications andI think that that's remix and so it'd be a responsible for me to do it any other way.

So anyway, we're going to be probably using remix and we're probably going to use a real database and this presents a lot of challenges because I'm here to teach you how to build React applications and I need to limit the scope otherwise it the course will be just enormous.

And so I don't want to teach you how to set up a database and the easiest way to do that is to have you use Docker but then doctors and entirely different subject as well, that is also not easy. If you've never used it before I I'm struggling with it myself.

But anyway in the process of I'm gonna try and like give you a bunch of scripts that you just run these scripts and and everything will work and that's the hope provided that you get docker installed properly. So we'll see hopefully that works out nicely. But my the thing that I learned yesterday or kind of today is that there I set up a postgres database inside a Docker container and I have a Docker composed file and I was following a tutorial and one of the things that had in there was.

I guess I probably should have had this pulled up and ready for you it's Docker compose.Yeah, and it had oh I actually lost it had some like volume thing in here. And the and setting up the particular volume is basically where Docker is going to persist all of the data that is in the Postgres database so that when you close down the Docker container you can open it back up and all the data is still there.

And I had a lot of trouble because I would try and delete the image delete the container and create it all brand new but it would reuse the same volume and so,I wasn't able to just delete all the tables and whatnot. So finally, I figured out how to do that and and it was from help from people on the YouTube comments of the Line Street I needed yesterday and it's a simple as using Docker volume LS to list out all of the volumes that you have and then Docker volume RM and then providing the the name of the volume you want to remove and that deletes all the data.

And you can also do ducker volume prune and that will remove them all. So, that's what I learned.