Ubuntu – Error when trying to run snap install from ubuntu on docker

dockersnap

I'm getting the following error when trying to run simple snap test

snap install hello

Get the following error:

main.go:239: WARNING: cannot create syslog logger
error: cannot communicate with server: Post http://localhost/v2/snaps/hello: dial unix /run/snapd-snap.socket: connect: no such file or directory

Best Answer

You need to at least have snapd running in the container for a snap install to work as the snap command mostly sends restful messages to snapd to get things done.

Look at the service unit for snapd to see the parameters and environment setup required to run.

PS: This might get installation working, but the next hurdle will be stacking security profiles from docker and snapd

Related Question