Skip to content
/ imagefs Public
forked from fermayo/imagefs

[POC] Volume driver for Docker to mount image layers in containers

Notifications You must be signed in to change notification settings

caervs/imagefs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fermayo/imagefs

POC ONLY

Volume plugin to mount images into containers

Usage

Install the plugin

docker plugin install fermayo/imagefs

Create a task with a new volume

docker service create --name ping --replicas 1 --restart-condition none --mount type=volume,volume-driver=fermayo/imagefs,volume-opt=source=alpine,target=/context,volume-opt=target=new alpine ping www.google.com
  • volume-opt=source is the image to mount
  • target is the directory in the service where the image will be mounted
  • volume-opt=target is the tag to give to the new volume snapshot Note that if the tag contains a registry URL the image will be pushed when the volume is unmounted

Modify the volume from within the service

tid=ping.1.$(docker service ps -q ping)
docker exec -it $tid touch /context/hello

Remove the service

docker service rm ping

and see the contents of your newly created image

docker run -it --rm --entrypoint ls new

Limitations

  • Does not pull layers that are not present locally in the node
  • Only supports overlay2 graphdriver

About

[POC] Volume driver for Docker to mount image layers in containers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 86.9%
  • Makefile 12.6%
  • Shell 0.5%