docker volume prune - a podcast by Kent C. Dodds

from 2021-05-25T17:15:29

:: ::

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 morereal 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 Reactapplications 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 thescope 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 entirelydifferent 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 andthat'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 learnedyesterday 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 wasfollowing 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 volumething 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 Postgresdatabase 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 samevolume 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 peopleon 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 youhave 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.

Further episodes of 3 Minutes with Kent

Further podcasts by Kent C. Dodds

Website of Kent C. Dodds