canonical / docker-snap

https://snapcraft.io/docker
MIT License
55 stars 27 forks source link

Can not connect to external drives by default #33

Open yhojann-cl opened 3 years ago

yhojann-cl commented 3 years ago

By example, when work on external disk directory says an error:

$ sudo docker build -t test:1.0.0-alpha .;
error checking context: 'can't stat '/media/me/...''.

Fix using the snap connector:

$ sudo snap connect docker:removable-media;
$ sudo docker build -t test:1.0.0-alpha .;
Sending build context to Docker daemon  4.096kB
...

Please, plug the connector by default in installation.

tianon commented 3 years ago

I guess this is conceptually similar to docker:home -- do we get that one connected by default?

(FWIW, having this auto-connect by default is not something we can change directly in the snap, and would have to be a request to the Snap store team AFAIU.)

anonymouse64 commented 3 years ago

@tianon yes you have to request it from the store, I think docker has a reasonable claim to ask for auto-connection if folks want to use removable-media disk storage to build docker images, i.e. maybe you have some company internal network drive that has docker build stuff on it, if you mount it in the right place under /mnt/ or /media/, then it should be accessible to docker by default IMO