Skip to main content

Persistent Data Volumes

Hands-On Lab

 

Photo of joel

joel

Training Architect

Length

01:00:00

Difficulty

Intermediate

Persistent Data Volumes ### Mission Accomplished! Thanks to Droolidian graciousness & generosity, treats for the hungry SpaceBonians have been obtained - there's almost too much to handle! Greatful (& full, in general) SpaceBonians have once again raised their voices that President Squawk deliver a very special message to the wonderful person who lent a helping hand to reward deserving Good Boys & Girls. As a result, we have one more request of you, our star Docker expert.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

SpaceBones 2 - The Quest for More Yummies

Great job, cadet! SpaceBonians have created a special message for you! To view it, create a Docker volume containing the contents of /content-dockerquest-spacebones/volumes/ named missionstatus, then mount the volume on a new httpd container named fishin-mission running on port :80 to view it!

Instructions

  • if not already present, clone the content-dockerquest-spacebones repo on your machine
git clone https://github.com/linuxacademy/content-dockerquest-spacebones.git
  • create a new volume named missionstatus
docker volume create missionstatus
  • Use Docker commandline to print all information on the missionstatus volume.
docker volume inspect missionstatus
  • drop to root, then copy the contents of content-dockerquest-spacebones/volumes/ to missionstatus data directory
sudo -i
cp -r /home/user/content-dockerquest-spacebones/volumes/ /var/lib/docker/volumes/missionstatus/_data/
  • Exit root, then start a new container named fishin-mission using the httpd base image available on DockerHub, running on port 80.
docker run -d -p 80:80 --name fishin-mission 
    --mount source=missionstatus,target=/usr/local/apache2/htdocs httpd
  • Visit the server IP in your browser for a special thank you from SpaceBones residents!