【发布时间】:2020-02-11 14:00:42
【问题描述】:
好吧,我的 Dockerfile 出了点问题,实际上我尝试在几乎所有版本的 Debian 和 Ubuntu 上安装 snapd。
当我尝试启动命令时出现此错误
error: cannot communicate with server: Post http://localhost/v2/snaps/rocketchat-server: dial unix /run/snapd.socket: connect: no such file or directory
于是我尝试查看服务是否开启,并没有叫snapd的服务,即使我尝试用systemctl启动systemctl start snapd,还是报错
Failed to connect to bus: No such file or directory
所以我安装了dbus,当我现在重试时出现此错误
Failed to start snapd.service: Launch helper exited with unknown return code 1
我尝试使用 service 或 journalctl 启动服务,结果显示
snapd: unrecognized service
当我列出我的所有服务时,我有这个
[ - ] 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
我知道使用 docker 玩服务不好,但我不知道如何改进我的 Dockerfile,我从 Rocketchat doc debian 开始,然后是 ubuntu,然后是 snap(因为它更容易),以及所有这些我收到了这个错误。
【问题讨论】:
标签: docker ubuntu service debian dockerfile