Skip to content

Blobfuse2 Docker Container

Vikas Bhansali edited this page Mar 3, 2023 · 4 revisions

Installing Docker

Installing Docker Desktop on Windows

Steps to install: Link

Installing Docker on Ubuntu

Script to install: Link

Docker container image for Blobfuse2

Docker file used to build container image

Dockerfile

Build Docker image locally (based on latest Ubuntu distro)

Script

Docker command to pull pre-built container image

docker pull blobfuse2containers.azurecr.io/azure-blobfuse2.2.0.2

List and validate container image

docker images ls: this shall list image just built or downloaded as per above step

Running Blobfuse2 container image

Prepate for docker container

  • --cap-add=SYS_ADMIN: Adds sys-admin capabilities to linux kernel. This shall be supplied to 'docker run' command.
  • --device=/dev/fuse: Allows container to have access /dev/fuse device. This shall be supplied to 'docker run' command.
  • Export your Azure Storage Account credentials to environment variables. Below sample command uses these environment variables and exports them to container instance.
  • Syslog is configured inside container image and Blobfuse2 logs will go to /var/log/blobfuse2.log.
  • Inside container image, storage container is mounted on '/mnt/blobfuse_mnt'

Sample command to run container instance

docker run -it --rm --cap-add=SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined -e AZURE_STORAGE_ACCOUNT -e AZURE_STORAGE_ACCESS_KEY -e AZURE_STORAGE_ACCOUNT_CONTAINER blobfuse2containers.azurecr.io/azure-blobfuse2.2.0.2

Attach to running instance and use your mount

  • Run below command to list running instances and retrieve the instance id 'dokcer ps'
  • Use instance id to attach a shell to running instnace docker exec -it <instance id> bash

Unmount Blobfuse2 and stop container instance

docker exec -it <instance id> fusermount -u /mnt/blobfuse_mnt OR docker exec -it <instance id> unfuse

Clone this wiki locally