Skip to content
This repository has been archived by the owner on Aug 22, 2017. It is now read-only.

🐳 This is an open source volume plugin that allows using an ipfs filesystem as a volume.

License

Notifications You must be signed in to change notification settings

vdemeester/docker-volume-ipfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐳 docker-volume-ipfs

GoDoc Build Status Go Report Card License codecov

This is an open source volume plugin that allows using an ipfs filesystem as a volume.

$ docker-volume-ipfs &
$ docker run -it --rm -v QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT/readme:/data --volume-driver=ipfs busybox cat data
Hello and Welcome to IPFS!

β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β•  β•šβ•β•β•β•β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•β•šβ•β•     β•šβ•β•     β•šβ•β•β•β•β•β•β•

If you're seeing this, you have successfully installed
IPFS and are now interfacing with the ipfs merkledag!

 -------------------------------------------------------
| Warning:                                              |
|   This is alpha software. use at your own discretion! |
|   Much is missing or lacking polish. There are bugs.  |
|   Not yet secure. Read the security notes for more.   |
 -------------------------------------------------------

Check out some of the other files in this directory:

  ./about
  ./help
  ./quick-start     <-- usage examples
  ./readme          <-- this file
  ./security-notes

Goals

The main goal is to be able to create docker volumes that are backed by the IPFS filesystem.Β They could be named volumes, anonymous volumes. The plugin should also work in a cluster / swarm environment (but by its nature it should be built-in).

First, let's define a "format" for creating volumes. There is two cases: docker volume create and docker run -v.

For docker volume create, it could be an option ipfs=, ipns=...

$ docker volume create --driver=ipfs --opt ipfs=QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT --name ipfs-welcome
$ docker run -v ipfs-welcome:/ipfs/welcome busybox cat /ipfs/welcome/readme
Hello and Welcome to IPFS!

β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β•  β•šβ•β•β•β•β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•β•šβ•β•     β•šβ•β•     β•šβ•β•β•β•β•β•β•

If you're seeing this, you have successfully installed
# […]
# would also work with ipns
$ docker volume create --driver=ipfs --opt ipns=ipfs.io --name ipfs-io-website
$ docker run -v ipfs-io-website:/var/www/html nginx

For -v directly in docker run (a.k.a. anonymous volume), we could namespace it somehow.

# Default to ipfs
$ docker run -it --rm -v QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT/readme:/data --volume-driver=ipfs busybox cat data
Hello and Welcome to IPFS!
# […]
$ docker run -it --rm -v $(docker volume create --driver=ipfs --opt ipns=ipfs.io):/var/www/html --volume-driver=ipfs nginx

TODO(s)

  • Use ipfs daemon API instead of making the assumption that a daemon is running and mounting ipfs using fuse
  • Support ipfs mounts (via fuse)
  • Support ipns mounts
  • Create a volume v2 plugin

About

🐳 This is an open source volume plugin that allows using an ipfs filesystem as a volume.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published