Docker image based on ubuntu:18.04 which mounts an Azure blob container via Microsoft's FUSE driver.
|-------------|---------------------------------------------------------------------------------------------------| | Docker Hub: | jeffreybreen/ubuntu18-blobfuse | | github: | jeffreybreen/docker-ubuntu18-blobfuse |
The provided mount-blobfuse.sh entrypoint simply mounts the given blob
container at the specified mount point and then executes whatever
command was provided via exec "$@".
make shell is a shortcut for specifying /bin/bash to the docker run command.
The entrypoint expects the following environment variables:
AZURE_STORAGE_ACCOUNTAZURE_STORAGE_ACCESS_KEYorAZURE_STORAGE_SAS_TOKENAZURE_STORAGE_ACCOUNT_CONTAINERAZURE_MOUNT_POINT
Note: You must provide either AZURE_STORAGE_ACCESS_KEY or
AZURE_STORAGE_SAS_TOKEN. If you specify both, blobfuse will fail and
remind you "exactly one of the environment variables
AZURE_STORAGE_ACCESS_KEY or AZURE_STORAGE_SAS_TOKEN must be set."
As documented in the Makefile, there are (at least) three different
ways to handle these environment variables:
- If the calling shell already has the proper environment variables set,
simply naming them via the
-eflag todocker runwill safely pass in their values automatically:
ENV = \
-e AZURE_STORAGE_ACCOUNT \
-e AZURE_STORAGE_SAS_TOKEN \
-e AZURE_STORAGE_ACCOUNT_CONTAINER \
-e AZURE_MOUNT_POINT
- During development, it may be convenient to read these environment
variables into
makefrom a file (e.g., via theinclude .envdirective). You would then need to pass the names and values todocker runwhich would expose their values to the command line (andps):
ENV = \
-e AZURE_STORAGE_ACCOUNT="${AZURE_STORAGE_ACCOUNT}" \
-e AZURE_STORAGE_SAS_TOKEN="${AZURE_STORAGE_SAS_TOKEN}" \
-e AZURE_STORAGE_ACCOUNT_CONTAINER="${AZURE_STORAGE_ACCOUNT_CONTAINER}" \
-e AZURE_MOUNT_POINT="${AZURE_MOUNT_POINT}"
- A safer way to read these credentials from a file is to use the
--env-fileflag todocker run:
ENV = --env_file /path/to/azure_secrets.env
See this informative article by Vladislav Supalov for more information about passing environment variables to Docker containers, including with Docker Compose.