Using docker image to run snapd

James Cooke me at jamescooke.info
Wed Mar 1 21:25:34 UTC 2017


Hi there,

I've been struggling to get an Ubuntu 16.04 based docker image to run
`snapd` - TL;DR I now know it is because systemd is not running in the
image. As per Geoffroy VanCutsem's message here
(https://lists.ubuntu.com/archives/snapcraft/2017-February/003013.html)
I can see that one alternative might be to...

> start my daemons/services outside of systemd, from a simple script invoked by CMD in my Dockerfile.

Could someone point me at a list of services that need to be running to
be able to make a `snap install`? And / or any guidance on the commands
required to run those services?

If anyone is interested in the error that I'm getting it's like this, in
a clean `rastasheep/ubuntu-sshd:16.04` instance where I've sshed in as
root:

root at be16d952b015:~# apt-get install -y snapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apparmor busybox-initramfs cpio initramfs-tools initramfs-tools-bin
  initramfs-tools-core klibc-utils kmod libapparmor-perl libklibc
  liblzo2-2 linux-base snap-confine squashfs-tools udev
...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Processing triggers for initramfs-tools (0.122ubuntu8.8) ...

root at be16d952b015:~# snap install hello-world
2017/03/01 20:37:40.864580 main.go:220: WARNING: cannot create syslog
logger
error: cannot communicate with server: Post
http://localhost/v2/snaps/hello-world: dial unix /run/snapd-snap.socket:
connect: no such file or directory

This appears to be the same error as asked about here:
http://askubuntu.com/questions/849859/error-when-trying-to-run-snap-install-from-ubuntu-on-docker
(that's me in the comments).

Thanks,

James



--
James Cooke
Backend software developer
CV PDF: http://jamescooke.info/docs/james_cooke_cv.pdf
Website: http://jamescooke.info/




More information about the Snapcraft mailing list