title: Dockerfile, how install snap, snapd: unrecognized service
body: <p>well I got some problem with my Dockerfile, in fact I try to install <code>snapd</code> on Debian and Ubuntu in almost all version.</p>
  <p>When I try to launch a command I got this error</p>
  <p><code>error: cannot communicate with server: Post http://localhost/v2/snaps/rocketchat-server: dial unix /run/snapd.socket: connect: no such file or directory </code></p>
  <p>So I tried to see if the service is enabled, and there is no service called <code>snapd</code>, even if I try to start with systemctl <code>systemctl start snapd</code>, I have an error</p>
  <p><code>Failed to connect to bus: No such file or directory</code></p>
  <p>so I installed <code>dbus</code>, and when I try again now I have this error</p>
  <p><code>Failed to start snapd.service: Launch helper exited with unknown return code 1</code></p>
  <p>I tried to start the service with service or journalctl and it shows</p>
  <p><code>snapd: unrecognized service</code></p>
  <p>When I list all my services I have this</p>
  <pre><code> [ - ]  apparmor
  
   [ - ]  bootmisc.sh
  
   [ - ]  checkfs.sh
  
   [ - ]  checkroot-bootclean.sh
  
   [ - ]  checkroot.sh
  
   [ + ]  dbus
  
   [ - ]  hostname.sh
  
   [ ? ]  hwclock.sh
  
   [ - ]  killprocs
  
   [ - ]  mountall-bootclean.sh
  
   [ - ]  mountall.sh
  
   [ - ]  mountdevsubfs.sh
  
   [ - ]  mountkernfs.sh
  
   [ - ]  mountnfs-bootclean.sh
  
   [ - ]  mountnfs.sh
  
   [ ? ]  ondemand
  
   [ - ]  procps
  
   [ - ]  rc.local
  
   [ - ]  sendsigs
  
   [ + ]  udev
  
   [ - ]  umountfs
  
   [ - ]  umountnfs.sh
  
  [ - ]  umountroot
  
   [ - ]  urandom
  
  </code></pre>
  <pre><code>FROM ubuntu:16.04
  
  RUN apt-get update &amp;&amp; apt-get -y upgrade &amp;&amp;\
      apt-get install -y snap snapd
  
  RUN snap install rocketchat-server
  #&quot;error: cannot communicate with server: Post #http://localhost/v2/snaps/rocketchat-server: dial unix #/run/snapd.socket: connect: no such file or directory&quot;
  
  RUN snap --version
  #snap    2.40
  #snapd   unavailable
  #series  -
  
  EXPOSE 3000
  
  ENTRYPOINT Server is running .... &amp;&amp; tail -f /dev/null
  </code></pre>
  <p>I know that with docker playing with service is not good but I don't know how can I improve my Dockerfile, I begin with rocketchat doc debian, then ubuntu, then snap (because its easier), and with all of them I got this error.</p>