well I got some problem with my Dockerfile, in fact I try to install snapd on Debian and Ubuntu in almost all version.
When I try to launch a command I got this error
error: cannot communicate with server: Post http://localhost/v2/snaps/rocketchat-server: dial unix /run/snapd.socket: connect: no such file or directory
So I tried to see if the service is enabled, and there is no service called snapd, even if I try to start with systemctl systemctl start snapd, I have an error
Failed to connect to bus: No such file or directory
so I installed dbus, and when I try again now I have this error
Failed to start snapd.service: Launch helper exited with unknown return code 1
I tried to start the service with service or journalctl and it shows
snapd: unrecognized service
When I list all my services I have this
[ - ] 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
FROM ubuntu:16.04
RUN apt-get update && apt-get -y upgrade &&\
apt-get install -y snap snapd
RUN snap install rocketchat-server
#"error: cannot communicate with server: Post #http://localhost/v2/snaps/rocketchat-server: dial unix #/run/snapd.socket: connect: no such file or directory"
RUN snap --version
#snap 2.40
#snapd unavailable
#series -
EXPOSE 3000
ENTRYPOINT Server is running .... && tail -f /dev/null
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.