

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
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
By default, Docker containers don't retain any state from past containers. For example, if I:
However, if I restart the stopped container, it will have the changes I made. This is only worth mentioning because sometimes developers think that killing an old container and starting a new one is the same as restarting a process - but that's not true... it's more like resetting the state of the entire machine to the original image.
All this said, Docker does have ways to support "persistent state" through storage volumes. They're basically a filesystem that lives outside of the container, but can be accessed by the container.
Click to play video
Ghost is an open-source blogging software, kind of like WordPress. As you can imagine, blogging software that doesn't save your blog posts, would be pretty useless, so we'll install Ghost and use volumes to persist our data!
docker volume create ghost-vol
docker volume ls
docker volume inspect ghost-vol
Run and submit the CLI tests.