Sign inSign up

oh22/sftp-blobfuse

By oh22

•Updated over 4 years ago

SFTP Server with Azure Blob Storage mount support

Image
0

10K+

oh22/sftp-blobfuse repository overview

⁠SFTP Server with Azure Blob Storage mount support

⁠Securely share your files

Easy to use SFTP (SSH File Transfer Protocol⁠) server with OpenSSH⁠.

Added support for mounting Azure Blob Storage Containers.

⁠References

Forked Repository - atmoz/sftp⁠

Parent Image - Ubuntu 20.04⁠

Github - Blobfuse⁠

How to mount Blob storage as a file system with blobfuse⁠

⁠Requirements
⁠Fuse Device

In order to use Blobfuse, you need to pass the fuse device /dev/fuse to the container.

docker run

--device=/dev/fuse:/dev/fuse

docker-compose

devices:
  - "/dev/fuse:/dev/fuse"
⁠SYS_ADMIN capability

For mount to work, you need to run the container with the SYS_ADMIN capability turned on.

docker run

--cap-add SYS_ADMIN 

docker-compose

cap_add:
  - "SYS_ADMIN"
⁠Environment variables

The following environment variables need to be set.

NameDescription
AZURE_STORAGE_ACCOUNTName of the azure storage account
AZURE_STORAGE_ACCESS_KEYAccess key of the storage account
AZURE_STORAGE_SAS_TOKENSAS token of the storage account
AZURE_STORAGE_ACCOUNT_CONTAINERName of the blob storage container
AZURE_MOUNT_POINTBlobfuse mount point
SFTP_USERSUsername and Password

Notes:

  • You can either provide AZURE_STORAGE_ACCESS_KEY or AZURE_STORAGE_SAS_TOKEN. Providing both will result in an error.
  • The syntax for SFTP_USERS is username:password
  • The mount point AZURE_MOUNT_POINT should be set to a directory inside the user's home directory.
    • Example: If you create a user called foo you should set AZURE_MOUNT_POINT to /home/foo/<directory name>.
⁠Example - docker run

PowerShell

docker run `
    --cap-add SYS_ADMIN `
    --device=/dev/fuse:/dev/fuse `
    -p 2222:22 `
    -e AZURE_STORAGE_ACCOUNT="<Storage Account Name>" `
    -e AZURE_STORAGE_ACCESS_KEY="<Storage Account Access Key>" `
    -e AZURE_STORAGE_ACCOUNT_CONTAINER="<Storage Account Container>" `
    -e AZURE_MOUNT_POINT="/home/foo/mount" `
    -e SFTP_USERS="foo:password" `
    -d "oh22/sftp-blobfuse:latest"

Bash

docker run \
    --cap-add SYS_ADMIN \
    --device=/dev/fuse:/dev/fuse \
    -p 2222:22 \
    -e AZURE_STORAGE_ACCOUNT="<Storage Account Name>" \
    -e AZURE_STORAGE_ACCESS_KEY="<Storage Account Access Key>" \
    -e AZURE_STORAGE_ACCOUNT_CONTAINER="<Storage Account Container>" \
    -e AZURE_MOUNT_POINT="/home/foo/mount" \
    -e SFTP_USERS="foo:password" \
    -d "oh22/sftp-blobfuse:latest"
⁠Example - docker-compose
version: "3.8"

services:
  sftp-blobfuse:
    image: oh22/sftp-blobfuse:latest
    restart: always
    container_name: sftp-blobfuse
    security_opt:
      - apparmor:unconfined
    cap_add:
      - "SYS_ADMIN"
    devices:
      - "/dev/fuse:/dev/fuse"
    ports:
      - "2222:22/tcp"
    environment:
      - AZURE_STORAGE_ACCOUNT="<Storage Account Name>"
      - AZURE_STORAGE_ACCESS_KEY="<Storage Account Access Key>"
      - AZURE_STORAGE_ACCOUNT_CONTAINER="<Storage Account Container>"
      - AZURE_MOUNT_POINT="/home/foo/mount"
      - SFTP_USERS="foo:password"

Tag summary

Content type

Image

Digest

Size

45.6 MB

Last updated

over 4 years ago

docker pull oh22/sftp-blobfuse