- Lab
- A Cloud Guru
Storing Container Data in Azure Blob Storage
Using Docker volumes is the preferred method of locally storing container data. 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 us to back up the data in those volumes on our own. There is another option: storing our container data in the Cloud. It's not a solution for every problem, but this lab demonstrates another tool at our disposal. This lab shows how to mount a Blob Storage container onto our local system as a directory. We will then mount that directory into our Docker container. We will use an httpd container to serve the contents of that bucket as a webpage, but we can use it to share any common data between containers. This will demonstrate how flexible Docker can be. We can make changes to our bucket, and all our containers using the Blob Storage container will near-instantly have access to the content.
Path Info
Table of Contents
-
Challenge
Configuration and Installation
- Obtain Azure authentication credentials by using the Azure command line utility.
Note: Use the website, and authentication code in the terminal to get a login page, then use the portal login credentials provided in the lab.
- Set the environment variables
AZURE_STORAGE_ACCOUNT
, andAZURE_STORAGE_ACCESS_KEY
. - Install Microsoft's repository, available from
https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
. - Install
blobfuse
. - Configure FUSE to allow all users to mount the storage.
- Obtain Azure authentication credentials by using the Azure command line utility.
-
Challenge
Prepare the Storage
- Create a mount point on the server at
/mnt/widget-factory
and change its ownership to your user. - Mount the Azure Blob Storage Container to the new mount point using
blobfuse
. - Copy the website files to the Blob Storage Container.
- Verify that the files are present on the cloud.
- Create a mount point on the server at
-
Challenge
Use the Storage in a Container
- Run an
httpd
container to serve the website. Remember to mount the Blob Storage 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
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.