- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Storing Container Data in Google Cloud Storage
Using Docker volumes is the preferred method of storing container data locally. Volume support is built directly into Docker, making it an easy tool to use for storage, as well as more portable. However, storing container data in Docker volumes still requires you to back up the data in those volumes on your own. There is another option - storing your container data in the cloud. It's not a solution for every problem, but after this lab, you'll have another tool at your disposal. This lab will show you how to mount a Cloud Storage bucket onto your local system as a directory. You will then mount that directory into your Docker container. We will use an httpd container to serve the contents of that bucket as a webpage, but you can use it to share any common data between containers. This hands-on lab will demonstrate how flexible Docker can be. You can make changes to your bucket and all of your containers using the Cloud Storage bucket will near-instantly have access to the content.

Lab Info
Table of Contents
-
Challenge
Configuration and Installation
- Make a Google Cloud Storage Bucket.
- Install
gcsfuse
. The necessary yum repo configuration has been added to the server for you in/etc/yum.repos.d/gcsfuse.repo
. - Configure FUSE to allow all users to mount the storage.
-
Challenge
Prepare the Cloud Storage Bucket
- Create a mount point on the server.
- Mount the GCS Bucket.
- Copy the website files into the Cloud Storage Bucket mounted on the server.
- Verify the files are present in the bucket.
-
Challenge
Use the GCS Bucket in a Container
- Run an
httpd
container to serve the website. Remember to mount the Cloud Storage folder to the container and publish the web server port. - View the webpage in a browser. Use the server's public IP provided with the lab.
- Run an
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.