

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Volumes
incomplete
2: Run Ghost
incomplete
3: Creating a Website
incomplete
4: Persist
incomplete
5: Persist Quiz
incomplete
6: Delete a Volume
incomplete
7: Clean Up
incomplete
This lesson's interactive features are locked, please to keep using them
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
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.