We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Delete a Volume

Now that we're done playing with Ghost, let's save the space on our host machine by deleting the volume.

Click to play video

Assignment

Now that it's gone, let's see what happens if we try to start the Ghost container back up and attach it to a volume that doesn't exist.

docker run -d -e NODE_ENV=development -e url=http://localhost:3001 -p 3001:2368 -v ghost-vol:/var/lib/ghost ghost

Navigate to http://localhost:3001/ in your browser, and you should see a fresh CMS. That's weird, why no errors?

Run:

docker volume ls

The ghost-vol is back from the dead!?! It turns out the -v ghost-vol:/var/lib/ghost flag binds to a "ghost-vol" volume if it exists, otherwise, it creates it automatically!

So, we now have a fresh installation. Our post that was on the old volume is gone, but this new volume will persist if we don't delete it.

Run and submit the CLI tests.