RFS (Remote File System) is a powerful command-line tool that lets you efficiently store, distribute, and access filesystems across different storage backends. It solves common problems in file distribution by separating metadata from content, allowing for:
- Efficient file distribution - Share only the metadata, download content on-demand
- Reduced bandwidth usage - Only download the files you actually need
- Flexible storage options - Store content in local directories, ZDB, S3, or HTTP backends
- Docker image conversion - Convert Docker images to lightweight, mountable filesystems
- Web-based management - Manage your filesystems through a user-friendly web interface
- Flists: Compact metadata files that describe filesystems without containing the actual data
- On-demand access: Files are only downloaded when accessed, saving bandwidth and storage
- Content deduplication: Identical files are stored only once, even across different flists
- Multiple storage backends: Store content in directory, ZDB, S3, or HTTP backends
- Docker conversion: Convert Docker images to flists for efficient distribution
- Server functionality: Run a server for web-based flist management
- Sharding and replication: Distribute and replicate content across multiple storage backends
Convert Docker images to flists for more efficient distribution and usage:
# Convert a Docker image to an flist
rfs docker -i nginx:latest -s dir:///tmp/store
# Mount the resulting flist
sudo rfs mount -m nginx-latest.fl /mnt/nginx
Package and distribute large filesystems efficiently:
# Create an flist from a directory
rfs pack -m myapp.fl -s dir:///tmp/store /path/to/myapp
# Share the flist (typically <1MB) instead of the entire content
# Recipients can mount it and access files on-demand
sudo rfs mount -m myapp.fl /mnt/myapp
Publish and distribute web content efficiently:
# Create an flist from a website directory
rfs pack -m website.fl -s s3://user:pass@s3.example.com:9000/bucket /path/to/website
# Mount the website on a server
sudo rfs mount -m website.fl /var/www/html
Deploy applications with all their dependencies:
# Convert an application Docker image to an flist
rfs docker -i myapp:latest -s zdb://zdb.example.com:9900/namespace
# Deploy the application on multiple servers by mounting the flist
sudo rfs mount -m myapp-latest.fl /opt/myapp
# Install dependencies
sudo apt-get install -y build-essential fuse libfuse-dev
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# Clone the repository
git clone https://github.com/threefoldtech/rfs.git
cd rfs
# Build RFS
rustup target add x86_64-unknown-linux-musl
cargo build --features build-binary --release --target=x86_64-unknown-linux-musl
# Install the binary
sudo cp ./target/x86_64-unknown-linux-musl/release/rfs /usr/local/bin/
# Create a directory to use as a store
mkdir -p ~/rfs-store
# Create an flist from a directory
rfs pack -m ~/test.fl -s dir://~/rfs-store ~/my-directory
# Mount the flist
mkdir -p ~/mount-point
sudo rfs mount -m ~/test.fl ~/mount-point
# Access the files
ls -la ~/mount-point
# Unmount when done
sudo umount ~/mount-point
# Create a directory to use as a store
mkdir -p ~/rfs-store
# Convert a Docker image to an flist
rfs docker -i alpine:latest -s dir://~/rfs-store
# Mount the resulting flist
mkdir -p ~/mount-point
sudo rfs mount -m alpine-latest.fl ~/mount-point
# Run commands in the mounted filesystem
sudo chroot ~/mount-point /bin/sh -c "ls -la"
# Unmount when done
sudo umount ~/mount-point
# Create a configuration file
cat > config.toml << EOF
host = "localhost"
port = 3000
store_url = ["dir:///tmp/store"]
flist_dir = "flists"
jwt_secret = "your-secret-key"
jwt_expire_hours = 5
[[users]]
username = "admin"
password = "admin-password"
EOF
# Create the flists directory
mkdir -p flists/admin
# Run the server
rfs server --config-path config.toml
The rfs
command provides all the functionality you need to work with flists:
rfs pack
- Create flists from directoriesrfs mount
- Mount flists as filesystemsrfs unpack
- Extract flist contents to a directoryrfs docker
- Convert Docker images to flistsrfs server
- Run the RFS server for web-based managementrfs config
- Manage flist metadata and storesrfs clone
- Copy data between storesrfs flist tree
- Display flist contents as a tree structurerfs flist inspect
- Inspect file details within an flist- And more...
For detailed information about each command, use the --help
flag:
rfs --help
rfs pack --help
rfs mount --help
Comprehensive documentation is available in the docs directory:
- Getting Started - Installation and basic usage
- Creating Flists - How to create flists from directories
- Mounting Flists - How to mount and use flists
- End-to-End Flist Workflow - Complete workflow for creating and using flists
- Converting Docker Images - How to convert Docker images to flists
- End-to-End Docker Workflow - Complete workflow for Docker conversion
- Server Setup - How to set up the RFS server
- Website Publishing - How to publish websites using RFS
- Syncing Files - How to sync files between RFS servers
- RFS Command Reference
- RFS Server Setup and Usage
- Web Interface Guide
- Performance Tuning
- Troubleshooting
- GitHub Issues: Report bugs or request features on our GitHub repository
- Documentation: Comprehensive documentation is available in the docs directory
This project is licensed under the Apache License 2.0.