This is a research project on the viability of a filesystem API for controlling Docker containers. Before being public on git many hours were put into designing a simple base to further work on.
The fileserver relies on a tree system for dynamically generating information about containers. Upon reading the contents of the root directory the file server will dynamically generate a filesystem based on a list of currently running docker containers.
Make sure you have atleast go 1.23.2 installed for the docker sdk deps
Make sure you have docker installed
Make sure you have 9mount installed for the test script
To build the server:
go mod tidy
go build
To run the server:
./dockerfs_research
To mount the server manually:
mkdir -pv $HOME/n/dockerfs
9mount 'tcp!localhost!9999' $HOME/n/dockerfs
To unmount the server manually:
9umount $HOME/n/dockerfs
While running the server I recommend creating a few docker containers then running find on $HOME/n/dockerfs.
Run 3 or 4 times. Alternatively use any container image desired.
docker run -d -t ubuntu:latest /bin/bash
Using find will show the mapped information.
$ find $HOME/n/dockerfs
/home/maxine/n/dockerfs
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/Names
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/Names/0
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/Image
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/ImageID
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/Command
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/Created
/home/maxine/n/dockerfs/9666de49a66046f3625923cb289e7bb09d9d85aa42130449ef3bf7a2014af657/ID
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/ID
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/Names
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/Names/0
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/Image
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/ImageID
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/Command
/home/maxine/n/dockerfs/06156b840698661494c45c50d695b696ebcc9aae3059d7a2fc4e69feb128ed67/Created
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/ID
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/Names
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/Names/0
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/Image
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/ImageID
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/Command
/home/maxine/n/dockerfs/333cb4d6269b74c4c371f7352638aa0f6ed15a2f7ee61dc8890fd40390092072/Created
...
Try killing some containers using docker kill
then checking the filesystem again.
docker kill ContainerID