SFTP Server with Azure Blob Storage mount support
10K+
Easy to use SFTP (SSH File Transfer Protocol) server with OpenSSH.
Added support for mounting Azure Blob Storage Containers.
Forked Repository - atmoz/sftp
How to mount Blob storage as a file system with blobfuse
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"
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"
The following environment variables need to be set.
| Name | Description |
|---|---|
| AZURE_STORAGE_ACCOUNT | Name of the azure storage account |
| AZURE_STORAGE_ACCESS_KEY | Access key of the storage account |
| AZURE_STORAGE_SAS_TOKEN | SAS token of the storage account |
| AZURE_STORAGE_ACCOUNT_CONTAINER | Name of the blob storage container |
| AZURE_MOUNT_POINT | Blobfuse mount point |
| SFTP_USERS | Username and Password |
Notes:
AZURE_STORAGE_ACCESS_KEY or AZURE_STORAGE_SAS_TOKEN. Providing both will result in an error.SFTP_USERS is username:passwordAZURE_MOUNT_POINT should be set to a directory inside the user's home directory.
foo you should set AZURE_MOUNT_POINT to /home/foo/<directory name>.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"
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"
Content type
Image
Digest
Size
45.6 MB
Last updated
over 4 years ago
docker pull oh22/sftp-blobfuse