`snap` fails from inside docker container

I pulled the latest Ubuntu image from hub.docker.com

$ docker pull ubuntu

Everything downloaded correctly so I launched the container

$ docker run -it ubuntu

I installed snapd into the container

# apt update
...
All packages are up to date.
# apt install snapd
Get:1
...
done.

When I try to login, I am getting a failure

# snap login
2017/04/20 18:06:04.729212 main.go:220: WARNING: cannot create syslog logger
Email address: <>
Password of "":
error: cannot communicate with server: Post dial unix /run/snapd-snap.socket: connect: no such file or directory

I even tried sudo just to be sure...

# sudo snap login
bash: sudo: command not found
2

1 Answer

It takes more than that to get snapd working inside a Docker container. Check out Ogra's container here:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like