Introduction
Docker provides a wide range of Images that help to run the required applications or services in localhost without installing.
- Docker Image: mcr.microsoft.com/azure-storage/azurite.
- YAML: YAML stands for YAML Ain't Markup Language, but it originally stood for Yet Another Markup Language.
- Volume: Volumes are the preferred mechanism for persisting data generated by and used by Docker containers.
version: '3'
services:
azure-storage-emulator:
image: mcr.microsoft.com/azure-storage/azurite
container_name: azure-blob-storage
ports:
- "10000:10000" # Blob service
- "10001:10001" # Queue service
- "10002:10002" # Table service
volumes:
- azure-storage-volume:/opt/azurite/folder
environment:
- "ASPNETCORE_ENVIRONMENT=Development"
- "AZURE_STORAGE_ACCOUNT=<<storage_ccount_name>>"
- "AZURE_STORAGE_ACCESS_KEY=<<storage_key>>"
- "AZURE_STORAGE_BLOB_ENDPOINT=http://localhost:10000/storage_ccount_name"
volumes:
azure-storage-volume:
driver: local
Steps
- Save the yaml file.
- run the docker-compose up -d from the terminal/command prompt.
Conclusion
This helps us to run the Azure storage locally.